aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-util
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-08-24 15:16:11 -0300
committerSebastian <sebasjm@gmail.com>2021-08-24 15:16:33 -0300
commite22bdd52f7dc878738d1b1306a15ae0f573c30a2 (patch)
treefa436f991ea5bf88ff973007d300aea39a5efac6 /packages/taler-util
parent0bc235c64b6936aa092a2df40e0c4909e4ac05d5 (diff)
transaction details new ui
Diffstat (limited to 'packages/taler-util')
-rw-r--r--packages/taler-util/src/amounts.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/taler-util/src/amounts.ts b/packages/taler-util/src/amounts.ts
index e472de503..f0434be0e 100644
--- a/packages/taler-util/src/amounts.ts
+++ b/packages/taler-util/src/amounts.ts
@@ -402,6 +402,12 @@ export class Amounts {
*/
static stringify(a: AmountLike): string {
a = Amounts.jsonifyAmount(a);
+ const s = this.stringifyValue(a)
+
+ return `${a.currency}:${s}`;
+ }
+
+ static stringifyValue(a: AmountJson): string {
const av = a.value + Math.floor(a.fraction / amountFractionalBase);
const af = a.fraction % amountFractionalBase;
let s = av.toString();
@@ -417,7 +423,6 @@ export class Amounts {
n = (n * 10) % amountFractionalBase;
}
}
-
- return `${a.currency}:${s}`;
+ return s
}
}