first build
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { a as useConfigStore } from './server.mjs';
|
||||
|
||||
function usePrice(price, digit = true, unit) {
|
||||
const config = useConfigStore();
|
||||
if (!unit && unit !== "") unit = config.priceUnit;
|
||||
let _price = Math.ceil(price).toString();
|
||||
if (digit) {
|
||||
_price = _price.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
return `${_price} ${unit}`;
|
||||
}
|
||||
|
||||
export { usePrice as u };
|
||||
Reference in New Issue
Block a user