Decimal

Decimal

To only get 2 after the decimal option. %.1f Depends on your configuration.
Double, Float values.

let pi: Double = 3.14159265358979
String(format:"%.2f", pi)

SO | rounding-a-double-value-to-x-number-of-decimal-places-in-swift