import{k as i,m}from"./app-D9-EssCM.js";function h(r,e){return e?r.replace(/\B(?=(\d{3})+(?!\d))/g,e):r}function b(r,e,t,c,s){const n=r<0,a=Math.abs(r).toFixed(t),[l,d=""]=a.split(".");let o=d;if(t>0)for(o=o.replace(/0+$/,"");o.length<e;)o+="0";const p=h(l,s),f=t===0||o.length===0?p:`${p}${c}${o}`;return n?`-${f}`:f}function g(){const r=i(),e=m(()=>r.props.numberFormat?.decimal_separator??"."),t=m(()=>r.props.numberFormat?.thousands_separator??",");function c(n,u=0,a=2){return b(n,u,a,e.value,t.value)}function s(n,u="ZAR"){const a=(u||"ZAR").toUpperCase();return a==="ZAR"?"R"+c(n,2,2):new Intl.NumberFormat("en-ZA",{style:"currency",currency:a}).format(n??0)}return{decimalSeparator:e,thousandsSeparator:t,formatDecimal:c,formatCurrency:s}}export{b as f,g as u};
