Skip to content

Commit

Permalink
Improve NumberInput "parse" documentation for Firefox
Browse files Browse the repository at this point in the history
Fixes #4646
  • Loading branch information
Kmaschta authored Apr 7, 2020
1 parent 6ef44eb commit 663914d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ Mnemonic for the two functions:
Say the user would like to input values of 0-100 to a percentage field but your API (hence record) expects 0-1.0. You can use simple `parse()` and `format()` functions to archive the transform:

```jsx
<NumberInput source="percent" format={v => v*100} parse={v => v/100} label="Formatted number" />
<NumberInput source="percent" format={v => v * 100} parse={v => parseFloat(v) / 100} label="Formatted number" />
```

`<DateInput>` stores and returns a string. If you would like to store a JavaScript Date object in your record instead:
Expand Down

0 comments on commit 663914d

Please sign in to comment.