Double
public extension Double
extension Double: CustomOSLogMessageConvertible
-
API to convert second to milli seconds
Declaration
Swift
func toMilliSeconds() -> Double -
Rounds the double to decimal places value
- Example:
self -> 3.12345678 places: 3, output 3.123 self -> 3.12345678 places: 4, output 3.1235 self -> 3.123 places: 4, output 3.123 self -> 3.9999 places: 3, output: 4.0
Declaration
Swift
func roundToPlaces(places: Int) -> DoubleParameters
valueThe required decimal places.
Return Value
Computed double value.
- Example:
-
Clamps value to a non-negative integer with a max digit cap. NaN -> 0, +infinity -> upper bound, -infinity -> 0
Declaration
Swift
func boundedValue(maxDigits: Int = 9) -> Int