new UI and handle cashing

This commit is contained in:
2026-06-16 19:47:59 +03:30
parent 6e5ea0319f
commit 32dde73dff
4 changed files with 66 additions and 26 deletions
+8
View File
@@ -24,6 +24,14 @@ export function useTowDecimal(num: string | number): string | number {
return formatGroupedPrice(Math.round(+num * 100) / 100, false)
}
export function formatSignedPercentChange(value: number): string {
if (!value) return '0%'
const formatted = useTowDecimal(Math.abs(value))
const prefix = value > 0 ? '+' : '-'
return `${prefix}${formatted}%`
}
export function useFormat(num: string | number, unit = '') {
return usePrice(Math.abs(+useTowDecimal(num)), true, unit)
}