Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > interesting float to money conversion problem

Thread Tools

interesting float to money conversion problem

Posts: n/a
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.
> >
> > --
> >

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
float to string to float, with first float == second float Carsten Fuchs C++ 45 10-08-2009 09:47 AM
Money? What money? It never existed. joevan Computer Support 7 10-13-2008 12:05 PM
Float to int conversion by using two int variables for representation of the float variable k3n3dy C++ 15 04-20-2006 06:53 PM
need code to convert float format to internal java float format which is kept in 4 bytes integer Andy Java 7 05-10-2004 09:26 PM
Re: float->byte->float is same with original float image. why float->ubyte->float is different??? bd C Programming 0 07-07-2003 12:09 AM