summaryrefslogtreecommitdiff
path: root/anteraja.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-17 16:06:00 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-17 16:06:00 +0800
commit7b90ae5879f80ddb9f0a11aaa0fb63d16844fa59 (patch)
tree8ba868d507e03480faeeb779bfa4cc7cef5a2ff4 /anteraja.c
parentf09a04b548164a6571234b9800e5e29e185595db (diff)
Minimum unit price must be 1000 too for Anteraja
Diffstat (limited to 'anteraja.c')
-rw-r--r--anteraja.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/anteraja.c b/anteraja.c
index d743a54..14e32a0 100644
--- a/anteraja.c
+++ b/anteraja.c
@@ -115,8 +115,11 @@ void anteraja_order(const char *order_number, const char *service, const char *s
double weight = atof(items[i][WEIGHT]) * 1000.0;
if (weight < 100.0)
weight = 100.0;
- sprintf(item, ORDER_ITEM, items[i][DESCRIPTION], atoi(items[i][QUANTITY]),
- atoi(items[i][PRICE]), (int)weight);
+ double price = atof(items[i][PRICE]);
+ if (price < 1000.0)
+ price = 1000.0;
+ sprintf(item, ORDER_ITEM, items[i][DESCRIPTION], atoi(items[i][QUANTITY]), (int)price,
+ (int)weight);
total_weight += weight;
if (json)
json = realloc(json, strlen(json) + length + 1);