Commit 7e3a65bd by lee

update order currencyCode

parent 0dc28325
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
_order = order; _order = order;
_lbOrderNum.text = [NSString stringWithFormat:@"订单 %@",order.identifier ? order.identifier.stringValue:@""]; _lbOrderNum.text = [NSString stringWithFormat:@"订单 %@",order.identifier ? order.identifier.stringValue:@""];
// _lbTotalPrice.text = [NSString stringWithFormat:@"%@",[KWMStringUtil getEUR2CNYstring:order.totalPrice]]; // _lbTotalPrice.text = [NSString stringWithFormat:@"%@",[KWMStringUtil getEUR2CNYstring:order.totalPrice]];
_lbTotalPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormattedByCurrencyCode:order.totalPrice]; // _lbTotalPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormattedByCurrencyCode:order.totalPrice];
_lbTotalPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:order.totalPrice currencyCode:order.currency];
__block NSInteger fulfilledCount = 0; __block NSInteger fulfilledCount = 0;
[order.lineItems enumerateObjectsUsingBlock:^(BUYLineItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { [order.lineItems enumerateObjectsUsingBlock:^(BUYLineItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
...@@ -72,7 +73,8 @@ ...@@ -72,7 +73,8 @@
if (lineItem != nil) { if (lineItem != nil) {
_lineItem = lineItem; _lineItem = lineItem;
// self.lbPrice.text = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:lineItem.price]]; // self.lbPrice.text = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:lineItem.price]];
self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormattedByCurrencyCode:lineItem.price]; // self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormattedByCurrencyCode:lineItem.price];
self.lbPrice.text = [[KWMCurrencyUtil sharedInstance] priceFormatted:lineItem.price currencyCode:@"EUR"];
self.lbName.text = lineItem.title; self.lbName.text = lineItem.title;
self.lbSize.text = [NSString stringWithFormat:@"x%@/%@",lineItem.quantity,lineItem.variantTitle]; self.lbSize.text = [NSString stringWithFormat:@"x%@/%@",lineItem.quantity,lineItem.variantTitle];
} }
......
...@@ -16,5 +16,6 @@ ...@@ -16,5 +16,6 @@
- (NSString *)priceFormattedByCurrencyCode:(NSDecimalNumber *) pric; - (NSString *)priceFormattedByCurrencyCode:(NSDecimalNumber *) pric;
- (NSString *)fixFormatted:(NSString *) price; - (NSString *)fixFormatted:(NSString *) price;
- (NSDecimalNumber *) calcPriceByCurrencyCode:(NSDecimalNumber *) price; - (NSDecimalNumber *) calcPriceByCurrencyCode:(NSDecimalNumber *) price;
- (NSString *)priceFormatted:(NSDecimalNumber *)price currencyCode:(NSString *) code;
@end @end
...@@ -76,4 +76,10 @@ ...@@ -76,4 +76,10 @@
return price; return price;
} }
- (NSString *)priceFormatted:(NSDecimalNumber *)price currencyCode:(NSString *)code{
NSNumberFormatter *formatter = [self numberFormatter];
formatter.currencyCode = code;
return [formatter stringFromNumber:price];
}
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment