Update descriptions for pad and toDecimalMark

Missing prototypes in the code explanations.
This commit is contained in:
Angelos Chalaris
2020-03-06 09:58:07 +02:00
parent 6f77474128
commit dd9c96bbb5
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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');