Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mehedi250/numberflow
I create laravel package for number (integer, float) oparation like - removeExtraZero, fixDecimalPoint
https://github.com/mehedi250/numberflow
Last synced: 10 days ago
JSON representation
I create laravel package for number (integer, float) oparation like - removeExtraZero, fixDecimalPoint
- Host: GitHub
- URL: https://github.com/mehedi250/numberflow
- Owner: mehedi250
- License: mit
- Created: 2023-10-17T08:57:20.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-17T12:09:30.000Z (about 1 year ago)
- Last Synced: 2023-10-17T13:12:54.345Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Numberflow
I create laravel package for number (integer, float) oparation
## How to install package
In your laravel project composer.json file. Open the file and update include the following array somewhere in the object:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/mehedi250/Numberflow"
}
]Execute the following command to install the package:
composer require mehedi250/numberflow:master
## How to use in code
Add bellow line in php file
use Mehedi250\Numberflow\NumberFlow;
For remove extra zero from float number-
$number = 4.670000;
$newNumber = NumberFlow::removeExtraZero($number); // output: 4.67For make number in a fix decimal point number-
$number = 4.36455;
$newNumber = NumberFlow::fixDecimalPoint($number, 2); // output: 4.36### Example
removeExtraZero($number);
$targetNumber = 4.63210;
$result = $NumberFlow->fixDecimalPoint($targetNumber, 4);
//your code ..
}
}