In template
<div>{{ $money(12300).format() }}</div>
<div>{{ $percent(0.213).format() }}</div>
// render to
<div>123,00</div>
<div>21.3%</div>
In script
import { useMoney, usePercentage } from 'src/composables/useDecimal'
const money = useMoney(3e-7).format()
const percentage = usePercentage(0.22).format()
For more examples, please refer to the Documentation
- Add money plugin
- Add percent plugin
- Support different locale