gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-wallet-webex] branch master updated: remove wrong to


From: gnunet
Subject: [GNUnet-SVN] [taler-wallet-webex] branch master updated: remove wrong toFloat function
Date: Thu, 05 Jul 2018 00:22:29 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-webex.

The following commit(s) were added to refs/heads/master by this push:
     new a4edc3b1 remove wrong toFloat function
a4edc3b1 is described below

commit a4edc3b17f27de5866e11d04a1fc9bbd4d657867
Author: Florian Dold <address@hidden>
AuthorDate: Thu Jul 5 00:21:11 2018 +0200

    remove wrong toFloat function
    
    Amounts should never be converted to floats, the one use of the function 
was bogus.
---
 src/amounts.ts                   | 8 --------
 src/webex/pages/return-coins.tsx | 2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/amounts.ts b/src/amounts.ts
index 280cd636..1aefe07e 100644
--- 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
index ff998d86..278f8af9 100644
--- 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,
     };

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]