remove wrong toFloat function
Amounts should never be converted to floats, the one use of the function was bogus.
This commit is contained in:
parent
e9d280eaea
commit
a4edc3b17f
@ -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.
|
||||
|
@ -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,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user