Reputation: 743
I am using Laravel 5.5 and using rating system, after average result i am getting
5.0000
I just want to show only
5
OR
5.0
How is this possible in laravel?
I am using this package for rating: https://github.com/AbdullahGhanem/rating
Thank you!
Upvotes: 0
Views: 532
Reputation: 37
Please refer this link http://php.net/manual/en/function.floor.php
Use:
floor()
Upvotes: 1
Reputation: 5042
You can use
floor()
It will round a number down to the nearest integer. This will only work for positive values, which is an important assumption. For negative values, you'd want to use ceil()
, but checking the sign of the input value would be cumbersome.
Hope this helps you.
Upvotes: 1
Reputation: 1
It's work for me! [use function php number_format()](https://www.w3schools.com/php/func_string_number_format.asp" PHP number_format() Function")
Upvotes: 0