Coder Social home page Coder Social logo

money's Introduction

Laravel Convert Money

Latest Stable Version Latest Unstable Version Total Downloads License composer.lock

Introduction

My first package, convert number in money.

Installation

To install Money, just run the following command:

	composer require wilsilva/money

Configuration

After installing the Money library, register the WilSilva\Money\MoneyServiceProvider in your config/app.php configuration file:

'providers' => [
    // Other service providers...

    WilSilva\Money\MoneyServiceProvider::class,
],

Add the MoneyFacade facade to the aliases array in your app configuration file:

'Money' => WilSilva\Money\Facade\MoneyFacade::class,

To publish the config settings in Laravel 5 use:

	php artisan vendor:publish --provider="WilSilva\Money\MoneyServiceProvider"

If you change type money, only to change in config/money.php

<?php //config file

return [
	'money-type' => 'USD', // change to BRL for example
];

	

Usage

	echo Money::convertNumberToMoney(99.90); // dump $ 99,90
	// or
	echo Money::convertMoneyToNumber("$ 99,90"); // dump float 99.90

Helpers

 convert_number_to_money(15.50, "BRL") // dump R$ 15,50

 convert_money_to_number("R$2000,00", "BRL") // dump 2000.00

 offer_descount("$100,00", 20, "USD") // $ 80,00

License

The Money Library is open-sourced software licensed under the MIT license.

money's People

Contributors

wilsilva avatar lguima avatar

Stargazers

 avatar Amaury Catelan avatar André Santos avatar Emanuel Rosa avatar Silas Ribas Martins avatar

Watchers

James Cloos avatar  avatar

money's Issues

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.