gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant-backoffice] branch master updated: revert until fix wall


From: gnunet
Subject: [taler-merchant-backoffice] branch master updated: revert until fix wallet-core publishing
Date: Thu, 27 May 2021 20:29:38 +0200

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

sebasjm pushed a commit to branch master
in repository merchant-backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new 1732185  revert until fix wallet-core publishing
1732185 is described below

commit 1732185ac1d1dcc783b8f2489f2ce333b5254d92
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Thu May 27 15:29:07 2021 -0300

    revert until fix wallet-core publishing
---
 packages/frontend/src/utils/amount.ts | 50 +++++++++++++++++------------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/packages/frontend/src/utils/amount.ts 
b/packages/frontend/src/utils/amount.ts
index 731dc76..190e876 100644
--- a/packages/frontend/src/utils/amount.ts
+++ b/packages/frontend/src/utils/amount.ts
@@ -56,36 +56,36 @@ export function mergeRefunds(prev: 
MerchantBackend.Orders.RefundDetails[], cur:
 }
 
 export const multiplyPrice = (price: string, q: number) => {
-  const a = Amounts.parseOrThrow(price)
-  const r = Amounts.mult(a, q)
-  return Amounts.stringify(r.amount)
-  // const [currency, value] = price.split(':')
-  // const total = parseInt(value, 10) * q
-  // return `${currency}:${total}`
+  // const a = Amounts.parseOrThrow(price)
+  // const r = Amounts.mult(a, q)
+  // return Amounts.stringify(r.amount)
+  const [currency, value] = price.split(':')
+  const total = parseInt(value, 10) * q
+  return `${currency}:${total}`
 }
 
 export const subtractPrices = (one: string, two: string) => {
-  const a = Amounts.parseOrThrow(one)
-  const b = Amounts.parseOrThrow(two)
-  const r = Amounts.sub(a, b)
-  return Amounts.stringify(r.amount)
-  // const [currency, valueOne] = one.split(':')
-  // const [, valueTwo] = two.split(':')
-  // return `${currency}:${parseInt(valueOne, 10) - parseInt(valueTwo, 10)}`
+  // const a = Amounts.parseOrThrow(one)
+  // const b = Amounts.parseOrThrow(two)
+  // const r = Amounts.sub(a, b)
+  // return Amounts.stringify(r.amount)
+  const [currency, valueOne] = one.split(':')
+  const [, valueTwo] = two.split(':')
+  return `${currency}:${parseInt(valueOne, 10) - parseInt(valueTwo, 10)}`
 }
 
 export const rate = (one: string, two: string) => {
-  const a = Amounts.parseOrThrow(one)
-  const b = Amounts.parseOrThrow(two)
-  const af = Amounts.toFloat(a)
-  const bf = Amounts.toFloat(b)
-  return af / bf
-  // const [, valueOne] = (one || '').split(':')
-  // const [, valueTwo] = (two || '').split(':')
-  // const intOne = parseInt(valueOne, 10)
-  // const intTwo = parseInt(valueTwo, 10)
-  // if (!intTwo) return intOne
-  // if (!intOne) return 0
-  // return intOne / intTwo
+  // const a = Amounts.parseOrThrow(one)
+  // const b = Amounts.parseOrThrow(two)
+  // const af = Amounts.toFloat(a)
+  // const bf = Amounts.toFloat(b)
+  // return af / bf
+  const [, valueOne] = (one || '').split(':')
+  const [, valueTwo] = (two || '').split(':')
+  const intOne = parseInt(valueOne, 10)
+  const intTwo = parseInt(valueTwo, 10)
+  if (!intTwo) return intOne
+  if (!intOne) return 0
+  return intOne / intTwo
 }
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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