my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes BigDecimal in JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "BigDecimal in JavaScript" Watch "BigDecimal in JavaScript" New topic
Author

BigDecimal in JavaScript

dinesh chanchlani
Greenhorn

Joined: Jul 20, 2007
Posts: 6
Hi,

I am adding two BigDecimal numbers and storing the result in variable declared(var object) inside Java Script.The addition result can be as large as 999999999999999999.99.But such large value is not getting stored properly in JavaScript variable,it gets rounded off.Is there a way to store numbers of precision(18,2) in JavaScript variables?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Dinesh please carefully choose the forum.
Moving.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

There is no BigDecimal in JavaScript. That's a Java class.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: BigDecimal in JavaScript
 
Similar Threads
Loss of precision worry when using Math.pow()
Advantage of BigInteger Class
[ . . . and thanks]how to make from double "235.97999999993036" to double "235.97"
Arithmetic operations with large numbers
a hashkey for double precision numbers