Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
14 lines (14 loc) · 707 Bytes

File metadata and controls

14 lines (14 loc) · 707 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// https://www.ecma-international.org/ecma-262/10.0/index.html#sec-number.prototype.tofixed
export function __TS__NumberToFixed(this: number, fractionDigits?: number): string {
if (Math.abs(this) >= 1e21 || this !== this) {
return this.toString();
}
const f = Math.floor(fractionDigits ?? 0);
// reduced to 99 as string.format only supports 2-digit numbers
if (f < 0 || f > 99) {
throw "toFixed() digits argument must be between 0 and 99";
}
// throws "invalid format (width or precision too long)" if strlen > 99
// if (f < 80) return fmt; else try {return fmt} catch(_) { throw "toFixed() digits argument..." }
return string.format(`%.${f}f`, this);
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.