s-patompong / nano-converter-php

Library to convert Nano currency unit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nano converter

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Convert between Nano currency unit.

Support me

You can support me by send NANO to nano_3h9jnfh5j7j7bpyexb8uhze9fb35sy6gu6a8mhpzpj4ob1qnejfzkropmbw7

Installation

You can install the package via composer:

composer require s-patompong/nano-converter-php

Usage

Convert NANO to Raw.

$nano = new \SPatompong\NanoConverter\NANO("45.225513");
echo $nano->toRaw();

// Output: "45225513000000000000000000000000"

Convert Raw to NANO.

$raw = new \SPatompong\NanoConverter\Raw("7126405971523");
echo $raw->toNANO();

// Output: "0.000000000000000007126405971523"

It's important to note that the returned response is the object of BigDecimal class.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please email me at p.pangpond@gmail.com if you found vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Library to convert Nano currency unit

License:MIT License


Languages

Language:PHP 100.0%