All Projects â†’ dleitee â†’ Walletjs

dleitee / Walletjs

Licence: mit
💳A little library to handle money amounts.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Walletjs

RavenCoin-Wallet-With-Miners
RavenCoin Wallet including CPU and GPU miners! programs are directly from Ravencoin and official miner sources
Stars: ✭ 75 (-57.63%)
Mutual labels:  money, wallet
Zold
An Experimental Non-Blockchain Cryptocurrency for Fast Micro Payments
Stars: ✭ 183 (+3.39%)
Mutual labels:  wallet, money
Adrestia
APIs & SDK for interacting with Cardano.
Stars: ✭ 56 (-68.36%)
Mutual labels:  wallet, library
Walletconnect Monorepo
WalletConnect Monorepo
Stars: ✭ 230 (+29.94%)
Mutual labels:  wallet, library
Laravel Paystack
💳 📦 💰 Laravel 6, 7 and 8 Package for Paystack
Stars: ✭ 398 (+124.86%)
Mutual labels:  library, money
Ethkit
Ethereum dev toolkit for Go
Stars: ✭ 32 (-81.92%)
Mutual labels:  wallet, library
Javamoney Lib
JavaMoney financial libraries, extending and complementing JSR 354
Stars: ✭ 104 (-41.24%)
Mutual labels:  library, money
Json Api
Implementation of JSON API in PHP 7
Stars: ✭ 171 (-3.39%)
Mutual labels:  library
Move To Library Sketchplugin
You can now move symbol from your project to any library and re-attach all the symbol instances to this library. also it keep the overrides without any problems and it work with abstract that have libraries not in your local machine
Stars: ✭ 174 (-1.69%)
Mutual labels:  library
Confetti.js
A simple confetti animation for your website :)
Stars: ✭ 170 (-3.95%)
Mutual labels:  library
Dragview
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube New graphic component.
Stars: ✭ 171 (-3.39%)
Mutual labels:  library
Adaptive Tab Bar
AdaptiveController is a 'Progressive Reduction' Swift UI module for adding custom states to Native or Custom iOS UI elements. Swift UI component by @Ramotion
Stars: ✭ 2,032 (+1048.02%)
Mutual labels:  library
Fe
前端热门文章阅读
Stars: ✭ 174 (-1.69%)
Mutual labels:  library
Moneyfox
A way to make budgeting easy. A basic idea for the community, made even better by the community.
Stars: ✭ 170 (-3.95%)
Mutual labels:  money
Transitioner
A library for dynamic view-to-view transitions
Stars: ✭ 2,049 (+1057.63%)
Mutual labels:  library
Expanding Collection Android
ExpandingCollection is a material design card peek/pop controller. Android UI Library made by @Ramotion
Stars: ✭ 2,032 (+1048.02%)
Mutual labels:  library
Ksprefs
🚀⚡ Kotlin SharedPreferences wrapper & cryptographic preferences android library.
Stars: ✭ 176 (-0.56%)
Mutual labels:  library
Movingnumbersview
Moving numbers effect in SwiftUI
Stars: ✭ 175 (-1.13%)
Mutual labels:  library
Crawler Commons
A set of reusable Java components that implement functionality common to any web crawler
Stars: ✭ 173 (-2.26%)
Mutual labels:  library
Dimeshift
💰💰💰 the easiest way to track your expenses. Free. Open-source. Node.js
Stars: ✭ 173 (-2.26%)
Mutual labels:  money

"Mo money, No problems" - walletjs

Build Status Coverage Status Code Climate

IMPORTANT: We use big.js to handle huge numbers.

Now you can handle money without headaches!

API Reference

Install

npm install --save walletjs
or
yarn add walletjs

Examples

import Wallet, { Money } from 'walletjs'

const money = Money.init(100)
const wallet = Wallet.init(money)
console.log(wallet.getAmount(money.currency))

const money2 = Money.init(100)
const newWallet = wallet.add(money2)
console.log(newWallet.getAmount(money2.currency))

convertCurrency

import Wallet, { Money } from 'walletjs'

const money = Money.init(100, { currency: 'BRL' } )
const brlWallet = Wallet.init(money)
const usdWallet = brlWallet.convertCurrency('BRL', 'USD', 3.09)

console.log(brlWallet.getAmount('BRL')) => '100.00'
console.log(brlWallet.getAmount('USD')) => '0.00'

console.log(usdWallet.getAmount('BRL')) => '0.00'
console.log(usdWallet.getAmount('USD')) => '309.00'

no problems with float errors

// on javascript
const a = 0.1
const b = 0.2
console.log(a + b) => 0.30000000000000004

// on walletjs
const money = Money.init(0.2)
money.add(0.1) => returns 0.3
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].