Update descriptions for pad and toDecimalMark
Missing prototypes in the code explanations.
This commit is contained in:
@ -5,7 +5,7 @@ tags: string,beginner
|
||||
|
||||
Pads a string on both sides with the specified character, if it's shorter than the specified length.
|
||||
|
||||
Use `String.padStart()` and `String.padEnd()` to pad both sides of the given string.
|
||||
Use `String.prototype.padStart()` and `String.prototype.padEnd()` to pad both sides of the given string.
|
||||
Omit the third argument, `char`, to use the whitespace character as the default padding character.
|
||||
|
||||
```js
|
||||
|
||||
@ -3,7 +3,9 @@ title: toDecimalMark
|
||||
tags: utility,math,beginner
|
||||
---
|
||||
|
||||
Use `toLocaleString()` to convert a float-point arithmetic to the [Decimal mark](https://en.wikipedia.org/wiki/Decimal_mark) form. It makes a comma separated string from a number.
|
||||
Converts a number to a decimal mark formatted string.
|
||||
|
||||
Use `Number.prototype.toLocaleString()` to convert the numbre to decimal mark format.
|
||||
|
||||
```js
|
||||
const toDecimalMark = num => num.toLocaleString('en-US');
|
||||
|
||||
Reference in New Issue
Block a user