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);
/*didnt know about :
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  
 
 [ 5 post ] 

 Relevant Pages 

1. BUG: Memory Leak in JScript toString and toLocaleString Methods

2. toString() method with arrays

3. toString() Question

4. number toString?

5. Question about Server.HTMLEncode method on Unicode string.

6. Navigate Method Question

7. Print method and other questions

8. Method call question

9. Popup Method-- nTYPE argument question

10. Question To Michael Harris about Unicode and the CreateTextFile method

11. Calling a method in a vb dll from html page - newbie question

12. Question about methods and properties of DTC and script object model

 

 
Powered by phpBB® Forum Software