fix: 1/1 text

This commit is contained in:
Alexander Drozdov
2020-02-28 03:57:13 +02:00
parent b708ca3c9d
commit b3deabbec0
+2 -1
View File
@@ -231,7 +231,8 @@ export const Prices = new PriceService()
export function displayRounding (value: number, fraction: boolean = false): string {
if (fraction && Math.abs(value) < 1) {
if (value === 0) return '0'
return `1/${displayRounding(1 / value)}`
const r = `1/${displayRounding(1 / value)}`
return r === '1/1' ? '1' : r
}
if (Math.abs(value) < 10) {
return Number(value.toFixed(1)).toString()