You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with very large numbers (in this case, timestamps in nanoseconds), the default printing by swift results in an exponent character in the string. For example:
let largeNumber: Double = 1.52639622817888e+16
print("\(largeNumber)") // results in "1.52639622817888e+16"
Swagger-codegen version
2.3.1
Steps to reproduce
This is reproducible in an Swift project that uses Doubles for request parameters, as long as the input Double is sufficiently large.
Related issues/PRs
TBD
Suggest a fix/enhancement
Proposed fix is to switch to using NumberFormatter()
let formatter = NumberFormatter()
let num = NSNumber(value: bigNumber)
print(formatter.string(from: num)) // results in "15263962281788800"
The text was updated successfully, but these errors were encountered:
Description
When working with very large numbers (in this case, timestamps in nanoseconds), the default printing by swift results in an exponent character in the string. For example:
Swagger-codegen version
2.3.1
Steps to reproduce
This is reproducible in an Swift project that uses Doubles for request parameters, as long as the input Double is sufficiently large.
Related issues/PRs
TBD
Suggest a fix/enhancement
Proposed fix is to switch to using NumberFormatter()
The text was updated successfully, but these errors were encountered: