All Projects â†’ Flight-School â†’ Currencyconverter

Flight-School / Currencyconverter

Licence: mit
Utilities for doing currency conversion with the Money library

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Currencyconverter

Cashify
💸 Lightweight currency conversion library, successor of money.js
Stars: ✭ 329 (+321.79%)
Mutual labels:  currency, money, converter
currency-converter
💰 Easily convert between 32 currencies
Stars: ✭ 16 (-79.49%)
Mutual labels:  money, converter, currency
Laravel Money
Currency formatting and conversion package for Laravel
Stars: ✭ 261 (+234.62%)
Mutual labels:  currency, money
Jsr354 Api
JSR 354 - Money and Currency API
Stars: ✭ 262 (+235.9%)
Mutual labels:  currency, money
Swap
💱 Currency exchange rates library
Stars: ✭ 1,195 (+1432.05%)
Mutual labels:  currency, money
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 (-80.77%)
Mutual labels:  money, currency
swift-currency
Type-safety and algorithms for working with money in Swift.
Stars: ✭ 88 (+12.82%)
Mutual labels:  money, currency
Vue Numeric
Input field component to display a formatted currency value based on Vue.js
Stars: ✭ 341 (+337.18%)
Mutual labels:  currency, money
react-numeric
A react component for formatted number form fields
Stars: ✭ 30 (-61.54%)
Mutual labels:  money, currency
Money
A precise, type-safe representation of a monetary amount in a given currency
Stars: ✭ 817 (+947.44%)
Mutual labels:  currency, money
Dinero.js
Create, calculate, and format money in JavaScript and TypeScript.
Stars: ✭ 5,286 (+6676.92%)
Mutual labels:  currency, money
Go Money
Go implementation of Fowler's Money pattern
Stars: ✭ 887 (+1037.18%)
Mutual labels:  currency, money
Narvalo.NET
Applied functional patterns for C#. Money and Currency types. MVP framework. (Obsolete)
Stars: ✭ 16 (-79.49%)
Mutual labels:  money, currency
react-local-currency
💵 💴Shows the price of your services in the customer's currency 💶 💷
Stars: ✭ 21 (-73.08%)
Mutual labels:  money, currency
money
Crystal shard for dealing with money and currency conversion
Stars: ✭ 26 (-66.67%)
Mutual labels:  money, currency
Android Money
Simple money and currency converter library for android.
Stars: ✭ 66 (-15.38%)
Mutual labels:  currency, money
money-parser
Price and currency parsing utility
Stars: ✭ 26 (-66.67%)
Mutual labels:  money, currency
SwiftUI-Currency-Converter
Currency Converter project coded by SwiftUI and Swift5
Stars: ✭ 56 (-28.21%)
Mutual labels:  converter, currency
Money
PHP implementation of Fowler's Money pattern.
Stars: ✭ 3,868 (+4858.97%)
Mutual labels:  currency, money
Money
A money and currency library for PHP
Stars: ✭ 855 (+996.15%)
Mutual labels:  currency, money

CurrencyConverter

Build Status

Utilities for doing currency conversion with the Money library.

This functionality is discussed in Chapter 3 of Flight School Guide to Swift Numbers.

Requirements

  • Swift 4.0+

Installation

Swift Package Manager

Add the CurrencyConverter package to your target dependencies in Package.swift:

import PackageDescription

let package = Package(
  name: "YourProject",
  dependencies: [
    .package(
        url: "https://github.com/Flight-School/CurrencyConverter",
        from: "1.0.0"
    ),
  ]
)

Then run the swift build command to build your project.

Carthage

To use CurrencyConverter in your Xcode project using Carthage, specify it in Cartfile:

github "Flight-School/CurrencyConverter" ~> 1.0.0

Then run the carthage update command to build the framework, and drag the built CurrencyConverter.framework into your Xcode project.

Usage

A currency pair describes the relative value of one currency in terms of another. You can create a CurrencyPair object with a specified exchange rate to convert from a monetary amount in one currency to the other:

let EURtoUSD = CurrencyPair<EUR, USD>(rate: 1.17) // as of June 1st, 2018

let euros: Money<EUR> = 123.45
let dollars = EURtoUSD.convert(euros).rounded // "$144.44"

Note: This library doesn't include functionality for querying the current exchange rates of currencies. You can get this information from various third party web applications.

To only allow conversion in one direction, create a type that conforms to the UnidirectionalCurrencyConverter protocol. If you want to offer different rates depending on the direction of conversion (that is, a rate going from variable to fixed that isn't the inverse of going the other way) create a type that conforms to the BidirectionalCurrencyConverter protocol.

License

MIT

Contact

Mattt (@mattt)

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].