Latest 0.1.0
Homepage https://github.com/Sega-Zero/swift-iso-4217
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Small swift library to work with currencies in ISO-4217 format.

With this library you’ll get a correct price currency formatting for any ISO-4217 currency code that is supported by Apple’s Foundation.

For example, you got a server response like this:

{
"code": "EUR",
"value": 15
}

To achieve 15 € representation, all you need is to write 2 lines of code:

if let price = Price(value: 15, isoCode: "EUR") {
print(price)
}

Or

let price = Price(value: 15, currency: .eur)
print(price)

Having an instance of Price, you can get a nice string representation in a various ways:

print("(price)")

let string = String(describing: price)
print(string)

print(price.format(minimumFractionDigits: 2, decimalSeparator: "."))

⚠️ Please note, that this library is not indented to be used for any kind of money/currency calculations or conversions. If you need it, use Money pod, it is awesome.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

iso4217 is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "iso4217"

License

iso4217 is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "iso4217",
    "version": "0.1.0",
    "summary": "Small swift library to work with currencies in ISO-4217 format.",
    "homepage": "https://github.com/Sega-Zero/swift-iso-4217",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u0421u0435u0440u0433u0435u0439 u0413u0430u043bu0435u0437u0434u0438u043du043eu0432": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Sega-Zero/swift-iso-4217.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/SegaZero",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "iso4217/Classes/**/*",
    "pushed_with_swift_version": "3"
}

Pin It on Pinterest

Share This