interesting float to money conversion problem

Discussion in 'Python' started by Krishnakant, May 2, 2009.

  1. Krishnakant

    Krishnakant Guest

    hello all,
    > > I am using postgresql as a database server for my db application.
    > >
    > > The database is related to accounts and point of sales and many
    > > calculations involve money datatype.
    > >
    > > The application logic is totally done in python. Now the problem is
    > > that there is a situation where we calculate tax on % of the total
    > > amount on the invoice. The percentage is in terms of float but the
    > > eventual amount has to be in a money datatype.
    > >
    > > The product cost comes in money datatype from postgresql and the tax %
    > > comes in float. So I would like to know if python supports some thing
    > > similar to money datatype so that I can cast my total amount (in money )
    > > divided by tax% (in float ) so money divided by float should be the
    > > result and that result should be in money datatype.
    > > For example a product x has the cost Rs. 100 which is stored in the
    > > tabel as money type. and in the tax table for that product the VAT is
    > > 5% and this 5% is stored in float datatype. So after using both these
    > > values the resulting total 105Rs. should be in money type and not float.
    > > I awaite some reply,
    > > Thanks in advice.
    > > happy hacking.
    > > Krishnakant.
    > >
    > > --
    > > http://mail.python.org/mailman/listinfo/python-list
    Krishnakant, May 2, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sam
    Replies:
    1
    Views:
    8,791
    Prnda76
    Feb 11, 2010
  2. bd
    Replies:
    0
    Views:
    605
  3. k3n3dy
    Replies:
    15
    Views:
    974
    dan2online
    Apr 20, 2006
  4. Replies:
    12
    Views:
    847
    Logan Shaw
    Mar 31, 2008
  5. Carsten Fuchs
    Replies:
    45
    Views:
    1,505
    James Kanze
    Oct 8, 2009
Loading...

Share This Page