Number.uts 504 字节
Newer Older
Y
yurj26 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
import { describe, test, expect, Result } from './tests.uts'

export function testNumber(): Result {
    return describe("Number", () => {
        test('toFixed', () => {
            function financial(x: Number): String {
              return x.toFixed(2);
            }
            expect(financial(123.456)).toEqual('123.46');
            expect(financial(0.004)).toEqual("0.00");
            expect(financial(0)).toEqual("0.00");
            expect(financial(1)).toEqual("1.00");
        })
    })
}