Number

public struct Number

A collection of methods that allow formatting numbers as other types, primarily Strings.

Additional Initializers

Number String

  • Creates a String representation of number.

    Declaration

    Swift

    func makeString(
        using configurationClosure: (_ numberFormatter: NumberFormatter) -> Void
    ) -> String?

    Parameters

    configurationClosure

    Required. The block of code that configures NumberFormatter before the latter is used for transforming number into a String. Use this opportunity to set locale, currency code (if needed), rounding rules, and more. See documentation for all properties available to configure.

    numberFormatter

    The NumberFormatter that can be configured by the caller.