https://github.com/klaucode/eurocent-round
Function to round value to rounder value
https://github.com/klaucode/eurocent-round
euro finance money round
Last synced: 5 months ago
JSON representation
Function to round value to rounder value
- Host: GitHub
- URL: https://github.com/klaucode/eurocent-round
- Owner: klaucode
- License: mit
- Created: 2022-07-27T20:10:47.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-27T20:38:33.000Z (almost 4 years ago)
- Last Synced: 2025-10-06T05:53:54.990Z (9 months ago)
- Topics: euro, finance, money, round
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eurocent-round
Only single function `round` to round money value to 0.5 eurocent or any other required rounder.
*How to use:*
```
const round = require('eurocent-round');
const eurValue = 124.27;
const eurValueRounded = round(eurValue); // Return 124.5
```
*With the same way you can round to 0.05 with using second parameter of `round` function:*
```
const eurValue = 124.27;
// Set second rounder parameter to 0.05
const eurValueRounded = round(eurValue, 0.05); // Return 124.25
```
*Inside package is also available a mocha test:*
```
npm test
```