diff --git a/src/runtime/utils/math.ts b/src/runtime/utils/math.ts index f5c5794..da2e64f 100644 --- a/src/runtime/utils/math.ts +++ b/src/runtime/utils/math.ts @@ -1,9 +1,9 @@ -export function toPercentage(val: number, decimals = 0) { +export function toPercentage(val: number, decimals = 0): string { const percentage = (val * 100).toFixed(decimals) return `${percentage}%` } -export function roundToFixed(val: number | string, positions = 2) { +export function roundToFixed(val: number | string, positions = 2): number { let text = 0 if (typeof val === 'string') { text = +Number.parseFloat(val).toFixed(positions)