summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-12 20:12:39 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-12 20:12:39 +0200
commit6256bdb15a7c43b644132ae8c78adf31bcae4d28 (patch)
treeaffbc2d58bf792b276ee5e2c533fe16e96cf1871 /src/include
parent26f72f8572cf0d04cd0da718d34dad4ba479289c (diff)
downloadexchange-6256bdb15a7c43b644132ae8c78adf31bcae4d28.tar.gz
exchange-6256bdb15a7c43b644132ae8c78adf31bcae4d28.tar.bz2
exchange-6256bdb15a7c43b644132ae8c78adf31bcae4d28.zip
implement #6478, but untested as shown by FIXMEs
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_amount_lib.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/taler_amount_lib.h b/src/include/taler_amount_lib.h
index 63c5dba40..4f6d14004 100644
--- a/src/include/taler_amount_lib.h
+++ b/src/include/taler_amount_lib.h
@@ -206,6 +206,24 @@ TALER_amount_cmp (const struct TALER_Amount *a1,
/**
+ * Compare the value/fraction of two amounts. Does not compare the currency.
+ * Comparing amounts of different currencies will cause the program to abort().
+ * If unsure, check with #TALER_amount_cmp_currency() first to be sure that
+ * the currencies of the two amounts are identical. NBO variant.
+ *
+ * @param a1 first amount
+ * @param a2 second amount
+ * @return result of the comparison
+ * -1 if `a1 < a2`
+ * 1 if `a1 > a2`
+ * 0 if `a1 == a2`.
+ */
+int
+TALER_amount_cmp_nbo (const struct TALER_AmountNBO *a1,
+ const struct TALER_AmountNBO *a2);
+
+
+/**
* Test if @a a1 and @a a2 are the same currency.
*
* @param a1 amount to test