| 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 2 | * |
| 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 | |
| 7 | var gTestfile = 'tostring-001.js'; |
| 8 | |
| 9 | test(); |
| 10 | |
| 11 | function test() |
| 12 | { |
| 13 | var n0 = 1e23; |
| 14 | var n1 = 5e22; |
| 15 | var n2 = 1.6e24; |
| 16 | |
| 17 | printStatus ("Number formatting test."); |
| 18 | printBugNumber ("11178"); |
| 19 | |
| 20 | reportCompare ("1e+23", n0.toString(), "1e23 toString()"); |
| 21 | reportCompare ("5e+22", n1.toString(), "5e22 toString()"); |
| 22 | reportCompare ("1.6e+24", n2.toString(), "1.6e24 toString()"); |
| 23 | |
| 24 | } |
| 25 | |
| 26 |