Skip to content

Commit

Permalink
doc(format): improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
oumar-fall committed Oct 8, 2024
1 parent fc0f963 commit 2f586a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/morpho-ts/src/format/format/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The `format` object provides access to different formatters:
### Usage

Each formatter can be accessed through the `format` object and provides chainable methods to customize the output. The formatted value can be obtained calling `.of(value)` for `number` or `.of(value, decimals)` for `bigint`.
The return value will retain the nullability of the input value, unless a `.default()` method is applied (refer to [Number Formatter](#2-number-formatter) for details).
The return value will retain the nullability of the input value (giving priority to `value` over `decimals` for bigints, if none is defined), unless a `.default()` method is applied (refer to [Number Formatter](#2-number-formatter) for details).

> [!Tip]
> You can store the populated `of` function in a custom formatter:
Expand Down Expand Up @@ -71,7 +71,7 @@ const numberValue = format.number.of(123.45); // "123.45"
- `.unit(string)`: Adds a unit to the number (e.g., "$", "%").
- `.locale(string)`: Formats the number according to the specified locale.
- `.readable()`: Makes the value more readable for small numbers.
- `.default(string)`: Sets a default value in case value is `null` or `undefined`.
- `.default(string)`: Sets a default value in case `value` (or `decimals`) is `null` or `undefined`.

### 3. Commas Formatter

Expand Down

0 comments on commit 2f586a0

Please sign in to comment.