Lines Matching refs:Decimal

6     T.assertEqual(expected, new Decimal(n).toDP(dp, rm).valueOf());
13 Decimal.config({
22 T.assert(Decimal.prototype.toDP === Decimal.prototype.toDecimalPlaces);
484 tx(function () {new Decimal('12.345').toDP('2')}, ".toDP('2')");
485 tx(function () {new Decimal('12.345').toDP(new Decimal('2'))}, ".toDP(new Decimal('2'))");
486 tx(function () {new Decimal('12.345').toDP(null)}, ".toDP(null)");
487 tx(function () {new Decimal('12.345').toDP(NaN)}, ".toDP(NaN)");
488 tx(function () {new Decimal('12.345').toDP('NaN')}, ".toDP('NaN')");
489 tx(function () {new Decimal('12.345').toDP([])}, ".toDP([])");
490 tx(function () {new Decimal('12.345').toDP({})}, ".toDP({})");
491 tx(function () {new Decimal('12.345').toDP('')}, ".toDP('')");
492 tx(function () {new Decimal('12.345').toDP(' ')}, ".toDP(' ')");
493 tx(function () {new Decimal('12.345').toDP('hello')}, ".toDP('hello')");
494 tx(function () {new Decimal('12.345').toDP('\t')}, ".toDP('\t')");
495 tx(function () {new Decimal('12.345').toDP(new Date)}, ".toDP(new Date)");
496 tx(function () {new Decimal('12.345').toDP(new RegExp)}, ".toDP(new RegExp)");
497 tx(function () {new Decimal('12.345').toDP(7.5)}, ".toDP(7.5)");
498 tx(function () {new Decimal('12.345').toDP('1.1e1')}, ".toDP('1.1e1')");
499 tx(function () {new Decimal('12.345').toDP('-1')}, ".toDP('-1')");
500 tx(function () {new Decimal('12.345').toDP(-23)}, ".toDP(-23)");
501 tx(function () {new Decimal('12.345').toDP(1e9 + 1)}, ".toDP(1e9 + 1)");
502 tx(function () {new Decimal('12.345').toDP(1e9 + 0.1)}, ".toDP(1e9 + 1)");
503 tx(function () {new Decimal('12.345').toDP('-0.01')}, ".toDP('-0.01')");
504 tx(function () {new Decimal('12.345').toDP('-1e-1')}, ".toDP('-1e-1')");
505 tx(function () {new Decimal('12.345').toDP(Infinity)}, ".toDP(Infinity)");
506 tx(function () {new Decimal('12.345').toDP('-Infinity')}, ".toDP('-Infinity')");
508 tx(function () {new Decimal('12.345').toDP(1, '2')}, ".toDP(1, '2')");
509 tx(function () {new Decimal('12.345').toDP(1, new Decimal('2'))}, ".toDP(1, new Decimal('2'))");
510 tx(function () {new Decimal('12.345').toDP(1, null)}, ".toDP(1, null)");
511 tx(function () {new Decimal('12.345').toDP(1, NaN)}, ".toDP(1, NaN)");
512 tx(function () {new Decimal('12.345').toDP(1, 'NaN')}, ".toDP(1, 'NaN')");
513 tx(function () {new Decimal('12.345').toDP(1, [])}, ".toDP(1, [])");
514 tx(function () {new Decimal('12.345').toDP(1, {})}, ".toDP(1, {})");
515 tx(function () {new Decimal('12.345').toDP(1, '')}, ".toDP(1, '')");
516 tx(function () {new Decimal('12.345').toDP(1, ' ')}, ".toDP(1, ' ')");
517 tx(function () {new Decimal('12.345').toDP(1, 'hello')}, ".toDP(1, 'hello')");
518 tx(function () {new Decimal('12.345').toDP(1, '\t')}, ".toDP(1, '\t')");
519 tx(function () {new Decimal('12.345').toDP(1, new Date)}, ".toDP(1, new Date)");
520 tx(function () {new Decimal('12.345').toDP(1, new RegExp)}, ".toDP(1, new RegExp)");
521 tx(function () {new Decimal('12.345').toDP(1, 7.5)}, ".toDP(1, 7.5)");
522 tx(function () {new Decimal('12.345').toDP(1, '1.1e1')}, ".toDP(1, '1.1e1')");
523 tx(function () {new Decimal('12.345').toDP(1, '-1')}, ".toDP(1, '-1')");
524 tx(function () {new Decimal('12.345').toDP(1, -23)}, ".toDP(1, -23)");
525 tx(function () {new Decimal('12.345').toDP(1, 9)}, ".toDP(1, 9)");
526 tx(function () {new Decimal('12.345').toDP(1, 8.001)}, ".toDP(1, 8.001)");
527 tx(function () {new Decimal('12.345').toDP(1, '-0.01')}, ".toDP(1, '-0.01')");
528 tx(function () {new Decimal('12.345').toDP(1, '-1e-1')}, ".toDP(1, '-1e-1')");
529 tx(function () {new Decimal('12.345').toDP(1, Infinity)}, ".toDP(1, Infinity)");
530 tx(function () {new Decimal('12.345').toDP(1, '-Infinity')}, ".toDP(1, '-Infinity')");