Commit 95c407fd authored by Sandy's avatar Sandy

修改计算精度问题

parent 3e43ba17
...@@ -74,10 +74,9 @@ ...@@ -74,10 +74,9 @@
} }
#pragma mark enterprise alertView 企业版提示 #pragma mark enterprise alertView 企业版提示
- (void)enterpriseUpdate{ - (void)enterpriseUpdate{
NSString *path = [[NSBundle mainBundle]pathForResource:@"Info" ofType:@"plist"]; NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
NSDictionary* content =[NSDictionary dictionaryWithContentsOfFile:path];
NSString *version = [content valueForKey:@"CFBundleVersion"] ;
self.version=version; self.version=version;
// 获取服务器更新信息 // 获取服务器更新信息
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.2.4</string> <string>1.2.6</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.2.4</string> <string>0</string>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
......
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
//#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:7580/cruiser-server/rest" //#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:7580/cruiser-server/rest"
//********测试环境******** //********测试环境********
#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7280/cruiser-server/rest" //#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7280/cruiser-server/rest"
//********现场正式环境********* //********正式环境*********
// #define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7380/cruiser-server/rest" #define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7380/cruiser-server/rest"
#define HTTP_REST_REPORT_BASE_URL @"http://122.224.171.126:7380" #define HTTP_REST_REPORT_BASE_URL @"http://122.224.171.126:7380"
// HTTP // HTTP
//#define HTTP_REST_API_BASE_URL @"http://115.28.191.44:8080/IPatrol/rest" //#define HTTP_REST_API_BASE_URL @"http://115.28.191.44:8080/IPatrol/rest"
//10月23 122.224.171.126:7280 //10月23 122.224.171.126:7280
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
@property (nonatomic,copy) NSString *place;//产地 @property (nonatomic,copy) NSString *place;//产地
@property (nonatomic,copy) NSString *quality;//品质信息 @property (nonatomic,copy) NSString *quality;//品质信息
@property (nonatomic,strong) NSNumber *baseQty;//基础数量 @property (nonatomic,strong) NSNumber *baseQty;//基础数量
@property (nonatomic,strong) NSNumber *basePrice;//基础单价 @property (nonatomic,assign) NSNumber *basePrice;//基础单价
@property (nonatomic,strong) NSNumber *total;//金额 @property (nonatomic,strong) NSNumber *total;//金额
@property (nonatomic,copy) NSString *remark;//备注 @property (nonatomic,copy) NSString *remark;//备注
- (instancetype )initWithDict: (NSDictionary *)dict; - (instancetype )initWithDict: (NSDictionary *)dict;
......
...@@ -490,11 +490,13 @@ typedef enum : NSUInteger { ...@@ -490,11 +490,13 @@ typedef enum : NSUInteger {
- (void)setPacktAndTotalPrice{ - (void)setPacktAndTotalPrice{
if (self.basePrice && foundationUnitPrice.text.length > 0) { if (self.basePrice && foundationUnitPrice.text.length > 0) {
if (foundationQuantity.text.length > 0) { if (foundationQuantity.text.length > 0) {
float totalPrice = [self.basePrice floatValue] * [foundationQuantity.text floatValue]; float basePrice = [self.basePrice doubleValue];
totalMoney.text = [NSString stringWithFormat:@"%.2f",totalPrice]; float foundationQtt = [foundationQuantity.text doubleValue];
float totalPrice = basePrice * 1000 * foundationQtt;
totalMoney.text = [NSString stringWithFormat:@"%.2f",totalPrice / 1000];
self.totalPrice = [NSNumber numberWithFloat:totalPrice]; self.totalPrice = [NSNumber numberWithFloat:totalPrice];
if (packageQuantity.text.length > 0 && [packageQuantity.text floatValue] > 0) { if (packageQuantity.text.length > 0 && [packageQuantity.text floatValue] > 0) {
float packagePrice = totalPrice / [packageQuantity.text floatValue]; float packagePrice = totalPrice / [packageQuantity.text floatValue] / 1000;
packageUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice]; packageUnitPrice.text = [NSString stringWithFormat:@"%.2f",packagePrice];
self.packPrice = [NSNumber numberWithFloat:packagePrice]; self.packPrice = [NSNumber numberWithFloat:packagePrice];
} }
......
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