toString method question
Author Message
toString method question

I'm converting a 18 digit number returned from a stored procedure to a
string but get the last 3 digits rounded: 801000202153955200 should be
801000202153955190.

Any idea on how to use toString or another method?

TIA
Rubn

Wed, 23 Jul 2003 05:40:22 GMT
toString method question
Javascript only guarantees precision to 14 or so digits.

: I'm converting a 18 digit number returned from a stored procedure to a
: string but get the last 3 digits rounded: 801000202153955200 should be
: 801000202153955190.
:
: Any idea on how to use toString or another method?
:
: TIA
: Rubn
:
:
:

Wed, 23 Jul 2003 06:08:42 GMT
toString method question

Quote:

> I'm converting a 18 digit number returned from a stored
> procedure to a string but get the last 3 digits rounded:
> 801000202153955200 should be 801000202153955190.

> Any idea on how to use toString or another method?

Can your stored procedure return two 9-digit numbers (n/10^9 & n%10^9)?

--
Dave Anderson

Unsolicited commercial email will be read at a cost of \$500 per message. Use
of this email address implies consent to these terms.

Wed, 23 Jul 2003 07:04:58 GMT
toString method question
No doubt someone will come up with something simpler:

<BODY>
801000202153955190<BR>
801000202153955200<BR>
<SCRIPT>
var e0="801000202153955190"
var f0=e0.substring(5,e0.length);
Javascript only guarantees precision to 14 or so digits.
same for jscript too I guess so I split the string in 2
*/
var g0=f0/100
var h0=Math.round(g0)
var i0=h0*100
var j0=e0.substring(0,6);
var k0=j0.concat(i0)
document.write(k0)
</SCRIPT>
</BODY>

Quote:
> I'm converting a 18 digit number returned from a stored procedure to a
> string but get the last 3 digits rounded: 801000202153955200 should be
> 801000202153955190.

> Any idea on how to use toString or another method?

> TIA
> Rubn

Wed, 23 Jul 2003 09:54:18 GMT
toString method question
Thanks for the feedback
If you can't beat them...I guess I'll change my SP to return an string.

Quote:
> I'm converting a 18 digit number returned from a stored procedure to a
> string but get the last 3 digits rounded: 801000202153955200 should be
> 801000202153955190.

> Any idea on how to use toString or another method?

> TIA
> Rubn

Sat, 26 Jul 2003 01:35:53 GMT

 Page 1 of 1 [ 5 post ]

Relevant Pages