HighTechTalks DotNet Forums  

parseFloat(x, 2) does not work?

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss parseFloat(x, 2) does not work? in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Alice
 
Posts: n/a

Default parseFloat(x, 2) does not work? - 09-06-2005 , 06:49 AM






any javascript function can truncate a number to 2 digits after decimal point?

for example
=================
input value : 57.37444
return : 57.37

input value : 57.638
return : 57.64

Alice

Reply With Quote
  #2  
Old   
Alice
 
Posts: n/a

Default RE: parseFloat(x, 2) does not work? - 09-06-2005 , 07:06 AM






I just found out the solution and would like to share with you all. ^_^

num.toFixed(2);

(hee~hee~)

"Alice" wrote:

Quote:
any javascript function can truncate a number to 2 digits after decimal point?

for example
=================
input value : 57.37444
return : 57.37

input value : 57.638
return : 57.64

Alice

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.