15 lines
416 B
JavaScript
15 lines
416 B
JavaScript
import { a as useConfigStore } from './server.mjs';
|
|
|
|
function usePrice(price, digit = true, unit) {
|
|
const config = useConfigStore();
|
|
if (!unit && unit !== "") unit = config.priceUnit;
|
|
let _price = price.toString();
|
|
if (digit) {
|
|
_price = _price.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
}
|
|
return `${_price} ${unit}`;
|
|
}
|
|
|
|
export { usePrice as u };
|
|
//# sourceMappingURL=usePrice-B-5-jXKQ.mjs.map
|