Because JavaScript has no separate int or float types, with this number wrapper you can force number to be treated as float.
int
float
format("{}", 5); // "5.0"format("{}", float(5)); // "5.0"format("{:d}", float(5)); // Throws, cannot format float as int. Copy
format("{}", 5); // "5.0"format("{}", float(5)); // "5.0"format("{:d}", float(5)); // Throws, cannot format float as int.
Optional
Float number value.
Because JavaScript has no separate
intorfloattypes, with this number wrapper you can force number to be treated as float.