Money
Description
Money provides a two-way bound amount field that formats and sanitizes monetary values using accounting-js.
Installation
Install the package:
yarn add @enso-ui/money
The component can be consumed standalone or inside higher-level Enso form packages.
Features
- exports a single
Moneycomponent from the package root - supports input mode and read-only label mode
- sanitizes user input and rounds values to the configured precision
- customizes symbol, decimal separator, thousands separator, and positive/negative/zero formats
Usage
<script setup>
import Money from '@enso-ui/money';
</script>
<Money
v-model="amount"
symbol="€"
:precision="2" />
API
Money
Import: @enso-ui/money
Props:
modelValue: number | string | null = nulllabel: boolean = falsereadonly: boolean = falsedisabled: boolean = falseplaceholder: string | null = nullsymbol: string = '$'decimal: '.' | ',' = '.'thousand: ' ' | '.' | ',' = ','precision: number = 2positive: string = '%s %v'negative: string = '%s (%v)'zero: string = '%s --'tabindex: number | null = null
Emits:
update:modelValue
Behavior:
- shows formatted output when
labelis enabled - enters raw-edit mode on focus
- sanitizes, rounds, and emits the numeric value on input or blur
Depends On
accounting-jsfor money formatting and parsing.
Contributions
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!