<br>Do calculations in postgresql and then call that calculated value from the python.So no need to calculate in python at all<br><br><br>Njoy the share of Freedom,<br>Anusha Kadambala<br><div class="gmail_quote">On Sat, May 2, 2009 at 1:15 PM, Krishnakant <span dir="ltr"><<a href="mailto:krmane@gmail.com">krmane@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">hello all,<br>
I am using postgresql as a database server for my db application.<br>
<br>
The database is related to accounts and point of sales and many<br>
calculations involve money datatype.<br>
<br>
The application logic is totally done in python.  Now the problem is<br>
that there is a situation where we calculate tax on % of the total<br>
amount on the invoice.  The  percentage is in terms of float but the<br>
eventual amount has to be in a money datatype.<br>
<br>
The product cost comes in money datatype from postgresql and the tax %<br>
comes in float.  So I would like to know if python supports some thing<br>
similar to money datatype so that I can cast my total amount (in money )<br>
divided by tax% (in float ) so money divided by float should be the<br>
result and that result should be in money datatype.<br>
For example a product x has the cost Rs. 100 which is stored in the<br>
tabel as money type.  and in the tax table for that product the VAT is<br>
5% and this 5% is stored in float datatype.  So after using both these<br>
values the resulting total 105Rs. should be in money type and not float.<br>
I awaite some reply,<br>
Thanks in advice.<br>
happy hacking.<br>
Krishnakant.<br>
<font color="#888888"><br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>