remove wrong toFloat function

Amounts should never be converted to floats, the one use of the function was bogus.
This commit is contained in:
Florian Dold 2018-07-05 00:21:11 +02:00
parent e9d280eaea
commit a4edc3b17f
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
2 changed files with 1 additions and 9 deletions

View File

@ -264,14 +264,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.

View File

@ -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,
};