|
-
Dec 20th, 2009, 06:47 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] PHP Math Functions
Amount: Something - Something = 407325.96875
How do i can make this function => ~
I don't know what is it, but i want ~ the amount of items for being answer without 10239293(.29383)
Thanks.
-
Dec 20th, 2009, 08:16 AM
#2
Fanatic Member
Re: PHP Math Functions
you mean round 407325.96875 to a whole number? sorry i don't really get what you mean..
-
Dec 20th, 2009, 09:28 AM
#3
Thread Starter
Hyperactive Member
Re: PHP Math Functions
Yes i want it to be number without . between numbers it should say ~407326 without .96875
-
Dec 20th, 2009, 11:30 AM
#4
Re: PHP Math Functions
I'm not sure I get what you mean either, but you might be looking for the floor() function - it rounds down to a whole number.
-
Dec 20th, 2009, 11:35 AM
#5
Re: PHP Math Functions
or the round() function to round either down or up. or typecast it to being an int so that it autmatically removes decimal places.
PHP Code:
$var = (int) 30223424.24234234;
-
Dec 20th, 2009, 04:11 PM
#6
Fanatic Member
Re: PHP Math Functions
i'm sure he wants to round from the separator into a whole number... if he got 40.546 the number will turn into 41 or if its 40.3 it will turn into 40... if thats what he wants then this might help: http://php.net/manual/en/function.round.php
Code:
<?php
$var1 = "1534.4";
echo round($var1);
?>
-
Dec 20th, 2009, 04:35 PM
#7
Re: PHP Math Functions
uh, yeah, I mentioned that in my post already..
-
Dec 20th, 2009, 04:58 PM
#8
Fanatic Member
Re: PHP Math Functions
oh sorry didn't really read you post...
-
Dec 20th, 2009, 05:40 PM
#9
Thread Starter
Hyperactive Member
Re: PHP Math Functions
Thanks. Any suggestions for?: <?php $NormalTree = 13034431 - $_GET[Experience];
echo $NormalTree / 25 ?>
-
Dec 20th, 2009, 06:16 PM
#10
Re: PHP Math Functions
Code:
<?php $NormalTree = 13034431 - $_GET[Experience];
echo round($NormalTree / 25); ?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|