We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1f130e1 + 4892842 commit 183fd8dCopy full SHA for 183fd8d
src/runtime/utils/math.ts
@@ -1,9 +1,9 @@
1
-export function toPercentage(val: number, decimals = 0) {
+export function toPercentage(val: number, decimals = 0): string {
2
const percentage = (val * 100).toFixed(decimals)
3
return `${percentage}%`
4
}
5
6
-export function roundToFixed(val: number | string, positions = 2) {
+export function roundToFixed(val: number | string, positions = 2): number {
7
let text = 0
8
if (typeof val === 'string') {
9
text = +Number.parseFloat(val).toFixed(positions)
0 commit comments