yukabuk wrote:
This -- what? --> <http://www.jibbering.com/faq/#FAQ2_3>
Quote:
var numberObj = new Number(6.57634); |
There is no point in creating a Number object there, ...
Quote:
var formattedNumber = numberObj.toFixed(2); |
.... as it is created here implicitly.
var formattedNumber = (6.57634).toFixed(2);
or, parametrized:
var numberValue = 6.57634;
var formattedNumber = numberValue.toFixed(2);
However, you have missed this:
Quote:
ECMAScript Ed. 3.0 (JScript 5.5 [but buggy] and JavaScript 1.5)
introduced N.toFixed, the main problem with this is the bugs in
JScripts implementation. |
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7 (AT) news (DOT) demon.co.uk>