Commit 95c407fd authored by Sandy's avatar Sandy

修改计算精度问题

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