![]() |
Rounding?
How would you get a number to round if it went into a decimal, like let's say I have 100.2, how would i get that to automatically go to 100? Or is there not a way?
|
PHP's round() function, or sprintf() for older versions.
|
Thanks ^^
But umm.. with the round how would I use it? Like how would I get it to know that it goes a decimal over to round up to the nearest 1? |
You can use something like this:
PHP Code:
|
Vincent]So if I did
PHP Code:
PHP Code:
|
Correct. The round() function will always go to the nearest integer, while ceil() and floor() round up and down, respectively.
|
What if blah1 ended up being 205 and didn't have a decimal? Then what would happen?
|
If the number you are rounding is already an integer, it will stay the same. :)
|
All times are GMT. The time now is 11:10 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|