货币编号的格式

时间:2016-10-11 08:07:14

标签: ios xcode swift3

我创建了一个小型货币转换器。通过利弊我不知道如何给它一个千分隔符的格式。例如,结果是10 000 000. 10如果你能告诉我,我想感谢你。以下是我的代码

a = [0.0,1.0,2.0,3.0,4.0]
b = [1.0,2.0,3.0,5.0,6.0]

for i, j in zip(a[1:], b):
    if i != j:
        print(j, i)
#            5.0, 4.0

1 个答案:

答案 0 :(得分:1)

Hello swift已经为您的情况设置了货币UI风格

SWIFT 3

Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.6.2.qualifier): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Syntax error parsing [SELECT u FROM Users u NATURAL LEFT JOIN CourseMembers b WHERE b.courseMembersPK.userID IS NULL]. 
[21, 22] The FROM clause has 'Users u' and 'NATURAL LEFT JOIN CourseMembers b' that are not separated by a comma.
[30, 30] An identification variable must be provided for a range variable declaration.

SWIFT 2

 let amount = Int(usdamount.text!)
 let numberFormatter = NumberFormatter()
 numberFormatter.currencyCode = "USD"   
 numberFormatter.numberStyle = NumberFormatter.Style.currency 
 let newValue = numberFormatter.string(from: NSNumber(value: amount!))
 print(newValue)

enter image description here