s-patompong/nano-converter-php

Convert between Nano currency units.

1.0.0 2021-04-12 12:11 UTC

This package is auto-updated.

Last update: 2024-10-25 21:42:07 UTC


README

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.