taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit a4edc3b17f27de5866e11d04a1fc9bbd4d657867
parent e9d280eaea376d80bb6fd9895b9f19c6ad264b4c
Author: Florian Dold <florian.dold@gmail.com>
Date:   Thu,  5 Jul 2018 00:21:11 +0200

remove wrong toFloat function

Amounts should never be converted to floats, the one use of the function was bogus.

Diffstat:
Msrc/amounts.ts | 8--------
Msrc/webex/pages/return-coins.tsx | 2+-
2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/amounts.ts b/src/amounts.ts @@ -265,14 +265,6 @@ export function parseOrThrow(s: string): AmountJson { /** - * Convert the amount to a float. - */ -export function toFloat(a: AmountJson): number { - return a.value + (a.fraction / fractionalBase); -} - - -/** * Convert a float to a Taler amount. * Loss of precision possible. */ diff --git a/src/webex/pages/return-coins.tsx b/src/webex/pages/return-coins.tsx @@ -70,7 +70,7 @@ class ReturnSelectionItem extends React.Component<ReturnSelectionItemProps, Retu }); this.state = { currency: props.balance.byExchange[props.exchangeUrl].available.currency, - selectedValue: Amounts.toFloat(props.balance.byExchange[props.exchangeUrl].available).toString(), + selectedValue: Amounts.toString(props.balance.byExchange[props.exchangeUrl].available), selectedWire: "", supportedWires, };