addons/point_of_sale/static/src/app/models/decimal_precision.js
raw| 1 | import { registry } from "@web/core/registry"; |
| 2 | import * as numbers from "@point_of_sale/app/utils/numbers"; |
| 3 | |
| 4 | export class DecimalPrecision extends numbers.AbstractNumbers { |
| 5 | static pythonModel = "decimal.precision"; |
| 6 | get precision() { |
| 7 | return Math.pow(10, -this.digits); |
| 8 | } |
| 9 | } |
| 10 | |
| 11 | registry.category("pos_available_models").add(DecimalPrecision.pythonModel, DecimalPrecision); |