Skip to content

added Number.toFixed function #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
adding assert message
  • Loading branch information
JackTam1993 committed Nov 7, 2023
commit 07f496a80b645284bcb116502634b64bc6d92078
5 changes: 2 additions & 3 deletions devs/run-tests/02numbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,12 @@ function testEnumToString() {
function testToFixed() {
const numObj = 12345.6789;

assert(numObj.toFixed(5) === '12346') // '12346'; rounding, no fractional part
assert(numObj.toFixed(5) === '12346', 'testToFixed') // '12346'; rounding, no fractional part
}

testComma()
testNums()
testNaN()
testUnaryPlus()
testEnumToString()
testToFixed()

testToFixed()
2 changes: 0 additions & 2 deletions packages/core/src/corelib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ declare var String: StringConstructor
interface Boolean {}

interface NumberConstructor {
(number: Number): number
readonly prototype: Number
}

Expand All @@ -210,7 +209,6 @@ interface Number {
// todo
toFixed(digits?: number): string
}
interface Number {}

interface RegExp {}
interface IterableIterator<T> {}
Expand Down