Discussion:
[phpxmlrpc] Double upto two decimal place
G E T O U T
2008-07-14 14:36:56 UTC
Permalink
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.


Regards,
Deeps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.usefulinc.com/pipermail/phpxmlrpc/attachments/20080714/77=
3e4750/attachment.htm
Gaetano Giunta
2008-07-15 13:56:18 UTC
Permalink
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
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

Loading...