#029
Helpers
Two money helper functions evaluated inline: centsToDisplay and parseInputToCents.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Helpers" pattern (@codeatlasdev/ui demo #029, inputs/money-input) in my app.
Call get_demo({ ids: ["#029"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Formatting stored cents for display or parsing user-typed currency strings outside a MoneyInput.
Keep these library parts, with the props and tokens the demo uses:
- centsToDisplay, parseInputToCents from "@codeatlasdev/ui/forms"
Behaviour to keep:
- `centsToDisplay(123456)` is printed with its result
- `parseInputToCents('R$ 1.234,56')` is printed with its result
- Both helpers are imported from `@codeatlasdev/ui/forms`
- No input component is rendered
Reduced motion: the demo handles it; keep that branch.
Keyboard: not an interactive control.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
How it is built
- `centsToDisplay(123456)` is printed with its result
- `parseInputToCents('R$ 1.234,56')` is printed with its result
- Both helpers are imported from `@codeatlasdev/ui/forms`
- No input component is rendered
Related
Loading source.