[SOLVED] Curreny Representation
Posted: Mon Sep 05, 2005 9:01 am
Description of the task:
I would like to insert into a database a currency value from a form or retrive from a data a numeric (float) value and represent it as currency.
Description of the problem:
The insertion is being done, however the values from the from are not being inserted in true float (decimal) form. Example if the from submits:
11.00 dollars --->> 11 is stored
11.50 dollars --->> 11.5 is stored
11.75 dollars --->> 11.75 is stored
When the sorted values are accessed from the database they do not conform to the expected currency format (00.00).
Main Concerns and questions:
1.) Is there a way to store or specifiy to php to take trailing zeros.
2.) Is there a way to format retrived values a curreny.
I would like to insert into a database a currency value from a form or retrive from a data a numeric (float) value and represent it as currency.
Description of the problem:
The insertion is being done, however the values from the from are not being inserted in true float (decimal) form. Example if the from submits:
11.00 dollars --->> 11 is stored
11.50 dollars --->> 11.5 is stored
11.75 dollars --->> 11.75 is stored
When the sorted values are accessed from the database they do not conform to the expected currency format (00.00).
Main Concerns and questions:
1.) Is there a way to store or specifiy to php to take trailing zeros.
2.) Is there a way to format retrived values a curreny.