mozilla

Compare Revisions

Number.prototype.toPrecision()

Change Revisions

Revision 373473:

Revision 373473 by Nfroidure on

Revision 401269:

Revision 401269 by Qbk on

Title:
toPrecision
toPrecision
Slug:
JavaScript/Reference/Global_Objects/Number/toPrecision
JavaScript/Reference/Global_Objects/Number/toPrecision
Content:

Revision 373473
Revision 401269
tt81 
82// note that scientific notation might be returned in some circum
 >stances
83console.log((1234.5).toPrecision(2)); // "1.2e+3"

Back to History