All Projects → peek-travel → swift-currency

peek-travel / swift-currency

Licence: MIT License
Type-safety and algorithms for working with money in Swift.

Programming Languages

swift
15916 projects
shell
77523 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to swift-currency

Hippolyte
HTTP Stubbing in Swift
Stars: ✭ 109 (+23.86%)
Mutual labels:  carthage, spm
Columbus
A feature-rich country picker for iOS, tvOS and watchOS.
Stars: ✭ 23 (-73.86%)
Mutual labels:  carthage, spm
django-prices-openexchangerates
openexchangerates.org support for django-prices
Stars: ✭ 33 (-62.5%)
Mutual labels:  money, currency
binarium
Binarium cryptocurrency is the first one protected from ASICs
Stars: ✭ 14 (-84.09%)
Mutual labels:  money, currency
Narvalo.NET
Applied functional patterns for C#. Money and Currency types. MVP framework. (Obsolete)
Stars: ✭ 16 (-81.82%)
Mutual labels:  money, currency
pesa
A JS money lib whose precision goes up to 11 (and beyond).
Stars: ✭ 38 (-56.82%)
Mutual labels:  money, currency
money-parser
Price and currency parsing utility
Stars: ✭ 26 (-70.45%)
Mutual labels:  money, currency
Megacoin
Welcome to Megacoin MΣC - Around the World!
Stars: ✭ 16 (-81.82%)
Mutual labels:  money, currency
money
Crystal shard for dealing with money and currency conversion
Stars: ✭ 26 (-70.45%)
Mutual labels:  money, currency
react-numeric
A react component for formatted number form fields
Stars: ✭ 30 (-65.91%)
Mutual labels:  money, currency
bankster
Money Creation Made Easy
Stars: ✭ 30 (-65.91%)
Mutual labels:  money, currency
NeumorphismTab
Custom TabBarController with Neumorphism.
Stars: ✭ 78 (-11.36%)
Mutual labels:  carthage, spm
nova-money-field
Money Field for Laravel Nova
Stars: ✭ 71 (-19.32%)
Mutual labels:  money, currency
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-70.45%)
Mutual labels:  money, currency
CurrencyEditText
A simple EditText input designed to input decimal and currency values.
Stars: ✭ 18 (-79.55%)
Mutual labels:  money, currency
Guide-to-Swift-Numbers-Sample-Code
Xcode Playground Sample Code for the Flight School Guide to Swift Numbers
Stars: ✭ 92 (+4.55%)
Mutual labels:  money, currency
Jsr354 Ri
JSR 354 - Moneta: Reference Implementation
Stars: ✭ 223 (+153.41%)
Mutual labels:  money, currency
Prices
Python price handling for humans.
Stars: ✭ 248 (+181.82%)
Mutual labels:  money, currency
SwiftGradients
Useful extensions for UIViews and CALayer classes to add beautiful color gradients.
Stars: ✭ 15 (-82.95%)
Mutual labels:  carthage, spm
FinanceKit
FinanceKit is a Framework for iOS and Mac to build apps working with financial data, like money, currencies, stocks, portfolio, transactions and other concepts.
Stars: ✭ 15 (-82.95%)
Mutual labels:  money, currency

Swift Currency

MIT License Swift 5+

Package Tests codecov

Documentation Maintainability

Introduction

Swift Currency provides type-safe representations of ISO 4217 currencies in Swift.

It provides many conveniences for working with currencies, such as literal representations, string interpolation, and mathematics.

import Currency
import Foundation

let dollars = USD(30.01)
print(dollars)
// 30.01 USD
print(dollars * 2)
// 60.02 USD
print(dollars.distributedEvenly(intoParts: 6))
// [USD(1.68), USD(1.68), USD(1.68), USD(1.67), USD(1.67), USD(1.67)]

let pounds = GBP(109.23)
print(dollars + pounds)
// compile error

let jpy: JPY = 399
print("The total price is \(jpy.localizedString()).")
// "The total price is ¥399.", assuming `Foundation.Locale.current` is "en_US"

let euro = EUR(29.09)
print("Der Gesamtpreis beträgt \(localize: euro, for: .init(identifier: "de_DE")).")
// "Der Gesamtpreis beträgt 29,09 €."

For more detailed examples, see the usage guide.

Language and Platform Test Matrix

The following table shows the combination of Swift language versions and operating systems that receive regular unit testing.

Platform Swift 5 5.1 5.2 Trunk
macOS Latest
Ubuntu 18.04 (Bionic)
Ubuntu 16.04 (Xenial)

Installing

Swift Package Manager

The preferred installation method is with SPM. Just add the package reference to your Package.swift.

dependencies: [
    .package(url: "https://github.com/peek-travel/swift-currency", from: "0.6.0")
]

Carthage

To install with Carthage, just add the line gh "https://github.com/peek-travel/swift-currency" ~> 0.6.0 to your Cartfile.

Cocoapods

To install with CocoaPods, just add the line pod 'SwiftCurrency', '~> 0.6.0' to your Podfile.

Documentation

The API docs for the latest tagged release are always available at peek-travel.github.io/swift-currency.

For "how to use" guides, and additional information about the project, see the documentation.

Questions

For bugs or feature requests, file a new issue.

Changelog

SemVer changes are documented for each release on the releases page.

Contributing

Check out CONTRIBUTING.md for more information on how to help with SwiftCurrency.

Contributors

Check out CONTRIBUTORS.txt to see the full list. This list is updated for each release.

License

MIT

Copyright (c) 2020-present, Peek Travel Inc.

This project contains code written by others not affliated with this project. All copyright claims are reserved by them. For a full list, with their claimed rights, see NOTICE.txt

Swift is a registered trademark of Apple, Inc. Any use of their trademark does not imply any affiliation with or endorsement by them, and all rights are reserved by them.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].