aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-09-27 13:06:50 -0300
committerSebastian <sebasjm@gmail.com>2021-09-27 13:06:50 -0300
commitb1bf3538e62a3cc22a436cfc5041c07a2c5e32e9 (patch)
tree418d1f85392fd047888749c3dfec6657187b7eb9 /packages/taler-util
parent8cde98947ba1a6d8c7928578b053786c4e5db17f (diff)
some ui fixing from belen comments
Diffstat (limited to 'packages/taler-util')
-rw-r--r--packages/taler-util/src/amounts.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/taler-util/src/amounts.ts b/packages/taler-util/src/amounts.ts
index f0434be0e..5a8c7f06f 100644
--- a/packages/taler-util/src/amounts.ts
+++ b/packages/taler-util/src/amounts.ts
@@ -407,7 +407,7 @@ export class Amounts {
return `${a.currency}:${s}`;
}
- static stringifyValue(a: AmountJson): string {
+ static stringifyValue(a: AmountJson, minFractional: number = 0): string {
const av = a.value + Math.floor(a.fraction / amountFractionalBase);
const af = a.fraction % amountFractionalBase;
let s = av.toString();
@@ -416,7 +416,7 @@ export class Amounts {
s = s + ".";
let n = af;
for (let i = 0; i < amountFractionalLength; i++) {
- if (!n) {
+ if (!n && i >= minFractional) {
break;
}
s = s + Math.floor((n / amountFractionalBase) * 10).toString();