From 66fd4c9099768e80be54240e4106a648b9fa9fdf Mon Sep 17 00:00:00 2001 From: Joel Male Date: Fri, 16 Aug 2024 15:30:57 +1000 Subject: [PATCH] v1.0.1 --- README.md | 33 +++++++++++++++++++++++++++++++++ composer.json | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b44ae8a..6247bf8 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,39 @@ ## Configuration php artisan vendor:publish --provider="Wearepixel\Cart\CartServiceProvider" --tag="config" ``` +### Formatting Numbers + +The package by default does not use round to format numbers, and instead returns the number using floatval(). + +If you'd prefer this number to be rounded, you can customize the formatting in the configuration file. + +Defaults to false. + +```php +'format_numbers' => env('LARAVEL_CART_FORMAT_VALUES', false), +'round_mode' => env('LARAVEL_CART_ROUND_MODE', 'down'), +``` + +### Decimals + +You can customize the number of decimals in the configuration file. + +Defaults to 2. + +```php +'decimals' => env('LARAVEL_CART_DECIMALS', 2), +``` + +### Round Mode + +The package uses the `round` function to round the prices. You can customize the rounding mode in the configuration file. + +Defaults to `down`. + +```php +'round_mode' => env('LARAVEL_CART_ROUND_MODE', 'down'), +``` + ## HOW TO USE - [Usage](#usage) diff --git a/composer.json b/composer.json index 61ec46d..ada40b5 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "wearepixel/laravel-cart", - "version": "1.0.0", + "version": "1.0.1", "description": "A cart implementation for Laravel", "keywords": [ "laravel",