vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
31 lines (30 loc) • 653 B
JavaScript
import { p as s } from "./lib-2iaAPQ_c.js";
function l({
config: r = {
useValueParens: !1,
usePercentageParens: !0,
showValueFirst: !0
},
val: u,
percentage: t,
showVal: a = !0,
showPercentage: n = !0
}) {
if (!a && !n) return "";
const e = {
value: r.useValueParens ? s(u) : u,
percentage: r.usePercentageParens ? s(t) : t
};
return a && n ? r.showValueFirst ? `${e.value} ${e.percentage}` : `${e.percentage} ${e.value}` : a ? e.value : n ? e.percentage : "";
}
function p({
rounding: r,
num: u,
filler: t = "-"
}) {
return u.toFixed(r).split("").map((a) => t).join("");
}
export {
l as b,
p as f
};