added sale-price

This commit is contained in:
2026-03-07 16:09:22 +03:30
parent 2e4389e311
commit d4ddc1f987
4991 changed files with 489998 additions and 7072 deletions
@@ -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 };