1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import weightUtils from './weight.js';
export default {
data() {
return {
};
},
methods: {
},
filters: {
displayWeight(mg, unit) {
return weightUtils.MgToWeight(mg, unit) || 0;
},
displayPrice(price, symbol) {
let amount = '0.00';
if (typeof price === 'number') {
amount = price.toFixed(2);
}
return amount+' '+symbol;
},
},
};