[phpxmlrpc] Double upto two decimal place
Gaetano Giunta
giunta.gaetano at gmail.com
Tue Jul 15 08:55:44 BST 2008
G E T O U T a =E9crit :
>
> HI,
>
> i want to know is there any way to make double upto 2 decimal places, =
> cuz right now it is upto 4 decimal places. I have price format of =
> double value upto 2 decimal places. Any help will be appreciated.
Double in the spec is not 4 decimal. It is much more than that, but the =
limit is implementation dependant:
"What is the legal syntax (and range) for floating point values =
(doubles)? How is the exponent represented? How to deal with whitespace? =
Can infinity and "not a number" be represented? There is no =
representation for infinity or negative infinity or "not a number". At =
this time, only decimal point notation is allowed, a plus or a minus, =
followed by any number of numeric characters, followed by a period and =
any number of numeric characters. Whitespace is not allowed. The range =
of allowable values is implementation-dependent, is not specified"
To make use of 2 decimal places:
- round off the data to 2 decimal places before sending it
- round off the data to 2 decimal places after receiving it (or control =
that it only uses 2 decimal places)
bye
Gaetano
>
>
> Regards,
> Deeps
> ------------------------------------------------------------------------
>
> _______________________________________________
> phpxmlrpc mailing list
> phpxmlrpc at lists.usefulinc.com
> http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
> =
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.usefulinc.com/pipermail/phpxmlrpc/attachments/20080715/57=
33b8a1/attachment.htm
More information about the phpxmlrpc
mailing list