Skip to content

Commit 4892842

Browse files
dx: add type hints to math utils
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent f434683 commit 4892842

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/runtime/utils/math.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export function toPercentage(val: number, decimals = 0) {
1+
export function toPercentage(val: number, decimals = 0): string {
22
const percentage = (val * 100).toFixed(decimals)
33
return `${percentage}%`
44
}
55

6-
export function roundToFixed(val: number | string, positions = 2) {
6+
export function roundToFixed(val: number | string, positions = 2): number {
77
let text = 0
88
if (typeof val === 'string') {
99
text = +Number.parseFloat(val).toFixed(positions)

0 commit comments

Comments
 (0)