Re: Double upto two decimal place
Gaetano Giunta <[email protected]> Tue, 15 Jul 2008 09:55:44 +0200
| Newsgroups | gmane.comp.php.xml-rpc |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --===============1462835516== Content-Type: multipart/alternative; boundary="------------010106090300040708090009" This is a multi-part message in MIME format. --------------010106090300040708090009 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable G E T O U T a =E9crit : > > HI, > > i want to know is there any way to make double upto 2 decimal places,=20 > cuz right now it is upto 4 decimal places. I have price format of=20 > 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=20 limit is implementation dependant: "What is the legal syntax (and range) for floating point values=20 (doubles)? How is the exponent represented? How to deal with whitespace?=20 Can infinity and "not a number" be represented? There is no=20 representation for infinity or negative infinity or "not a number". At=20 this time, only decimal point notation is allowed, a plus or a minus,=20 followed by any number of numeric characters, followed by a period and=20 any number of numeric characters. Whitespace is not allowed. The range=20 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=20 that it only uses 2 decimal places) bye Gaetano > > > Regards, > Deeps > -----------------------------------------------------------------------= - > > _______________________________________________ > phpxmlrpc mailing list > [email protected] > http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc > =20 --------------010106090300040708090009 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> G E T O U T a écrit : <blockquote cite="mid:[email protected]" type="cite"><br clear="all"> HI,<br> <br> 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.<br> </blockquote> Double in the spec is not 4 decimal. It is much more than that, but the limit is implementation dependant:<br> "<tt>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</tt>"<br> To make use of 2 decimal places:<br> - round off the data to 2 decimal places before sending it<br> - round off the data to 2 decimal places after receiving it (or control that it only uses 2 decimal places)<br> <br> bye<br> Gaetano<br> <blockquote cite="mid:[email protected]" type="cite"><br> <br> Regards,<br> Deeps<br> <pre wrap=""> <hr size="4" width="90%"> _______________________________________________ phpxmlrpc mailing list <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a> <a class="moz-txt-link-freetext" href="http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc">http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc</a> </pre> </blockquote> <br> </body> </html> --------------010106090300040708090009-- --===============1462835516== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ phpxmlrpc mailing list [email protected] http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc --===============1462835516==--