有人请帮助我如何将nsdecimalnumber值转换为String这里是code.But无法正常工作.
// Return type is NSDecimalNumber
var price = prod.minimumPrice // 10
// need a String
cell.priceLB.text = NSString(format:"%f", prod.minimumPrice) as String
Run Code Online (Sandbox Code Playgroud) 如何以最佳方式从此错误结果中获取消息值。我尝试了很多但从未获得价值,所以请帮助我
BUYClient.sharedClient.createCustomer(with: credentials) { (customer : BUYCustomer?,token: BUYCustomerToken?, error :Error?) -> Void in
if customer != nil{
print(token ?? "kuch nahi aaya")
print(customer?.fullName ?? "kuch nahi aaya")
}
let customer = error.debugDescription
print("value===\(customer)")
}
Run Code Online (Sandbox Code Playgroud)
结果 :
value===Optional(Error Domain=BUYShopifyErrorDomain Code=422 "(null)" UserInfo={errors={
customer = {
email = (
{
code = taken;
message = "has already been taken";
options = {
"rescue_from_duplicate" = 1;
value = "y@gmail.com";
};
}
);
};
}})
Run Code Online (Sandbox Code Playgroud)