Int

public extension Int

Int+TimeFormattable is used to format a number into time span string.

Author

Adamas

Version

1.5.0

Date

30/03/2019
  • Convert the number into time span string. Such as “3 Hrs”.

    Declaration

    Swift

    func timeString(withPrecision precision: Int = Self.max,
                    withAbbreviation shouldUseAbbreviation: Bool = false) -> String

    Parameters

    precision

    How many units should be included.

    shouldUseAbbreviation

    Whether the time description should be abbreviation or not.

    Return Value

    The time span string.