python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Parse string with currency symbol and value
I am trying to parse a list of input strings from an Excel file that can have a 'currency' value, and it could be in any currency. For e.g.
$200
£300
€200
CA$300
What's the best way to parse out the...
Z S
Votes: 0
Answers: 2
NSNumberFormatter and .floor roundingMode
Can someone tell me why this happening?
let formatter = NumberFormatter.init()
formatter.numberStyle = .decimal
formatter.usesGroupingSeparator = false
formatter.roundingMode = .floor
formatter.minimu...

Giorgio
Votes: 0
Answers: 1
String number with limited precision fraction digits in Swift
What would be the fastest way to convert a String number "1234.5678" to an NSNumber with precision -> 1234.56 and back to String "1234.56".
let numberFormatter = NumberFormatter...
Artiom
Votes: 0
Answers: 2
NSNumberFormatter Handling of Very High Precision Decimals Reduced from Xcode 13
Xcode 12 and below used to be able to handle decimals with many more digits than Xcode 13. The below code on Xcode 12 & 13 produces very different result:
let formatter = NumberFormatter()
formatt...
Zachary Nguyen
Votes: 0
Answers: 0