Giter Site home page Giter Site logo

toman's Introduction

Toman

(تومن in persian)

It contains all the information about the international currencies based on ISO 4217. You can access all of these currencies in the CurrencySource which is a static class. You can use it to find a specific currency by it's curencyCode or symbol.

کتابخانه تومن به شما کمک می کند تا با مقادیر پولی و مالی به شکل مناسب تری کاز کنید. تومن لیستی از واحدهای بین المللی بر اساس استاندارد ISO 4217 را به شما ارائه می دهد که با استفاده از آن ها می توانید با تنظیم نرخ مبادله با ریال، از قابلیت های تبدیل این کتابخانه استفاده کنید.

Features

  • Representing ISO 4217 Currencies in a static class
  • Find currencies based on it's symbol or numeric code
  • Implements Rial class which encapsulates Iranian currency with a specific value
  • Provides data source for keeping ExchangeRates against other international currencies TomanExchangeSource
  • Converts Rial values to Toman (Unofficial Iranian Currency)
  • Converts Rial values to another international currency based on rates defined in TomanExchangeSource

How to Use

You clone this repo, build it and add reference to the output assembly, or simply install it via nuget.

dotnet add package Toman

Finding all international currencies

using Toman;

var all = CurrencySource.FindAll();

Find a currency based on it's symbol or code

using Toman;

var usd = CurrencySource.FindByCode("USD");

Creating a Rial value

using Toman;

var money = new Rial(100000);
Console.WriteLine($"Value: {money.Value}");

Setting an ExchangeRate for a specific Currency and creates Rial value from it

using Toman;

TomanExchangeSource.SetRate("USD", 500000);
var rial = Rial.From("USD", amount: 120.56);
Console.WriteLine($"120.56 USD = {rial.Value} rial and {rial.InToman()} toman");

toman's People

Contributors

imaun avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.