From 7b90ae5879f80ddb9f0a11aaa0fb63d16844fa59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sat, 17 Jul 2021 16:06:00 +0800 Subject: Minimum unit price must be 1000 too for Anteraja --- anteraja.c | 7 +++++-- 1 file 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); -- cgit v1.2.3