Toggle navigation
Dashboard
Dashboard Tracker
Add / Edit My Forums
System Announcements
Discussion
Active Thread Feed
Top Threads Today
Top Threads This Week
Top Threads Library
Go!
View All
View All
Login
Logout
Home
Forums Index
Server Side
/
PHP Server Side Scripting
3:41 pm May 21, 2026
This page requires javascript.
Forum Moderators:
coopster
Message Too Old, No Replies
how to eliminate decimal values? Urgent help required
nandla
Msg#:4179606
4:57 am on Jul 31, 2010
(gmt 0)
i'm new in php.
kindly tell me how to eliminate decimal values in php string.
e.g,
<?PHP
$kanal = "5.0236";
?>
how to make its output only 5 without decimal and after decimal values. ?
nandla
Msg#:4179613
5:08 am on Jul 31, 2010
(gmt 0)
thanks guys! I've found its solution in exploding a string ;)
dreamcatcher
Msg#:4179626
6:07 am on Jul 31, 2010
(gmt 0)
<?php
$kanal = "5.0236";
echo number_format($kanal,0);
?>
dc
nandla
Msg#:4179627
6:14 am on Jul 31, 2010
(gmt 0)
thanks for replying but this won't work coz it required PHP 5.3.x to work, so it didn't work for me in localhost
rocknbil
Msg#:4179814
4:55 pm on Jul 31, 2010
(gmt 0)
echo intval($number); should do it too.
intval()
[us3.php.net]
Readie
Msg#:4179834
5:13 pm on Jul 31, 2010
(gmt 0)
Another alternative is the floor() function.
dreamcatcher
Msg#:4179944
10:34 pm on Jul 31, 2010
(gmt 0)
thanks for replying but this won't work coz it required PHP 5.3.x to work, so it didn't work for me in localhost
Not true. number_format has worked since PHP4.
dc
Join The Conversation
Register
For Free! -
Become a
Pro Member
!
See forum categories
-
Enter the Forum
Moderators and Top Contributors
Moderator List
| Top Contributors:
This Week
,
This Month
,
Apr
,
Mar
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
May 2026 Google Search Observations
AdSense Earnings and Observations - May 2026
AI visibility audit
Adsense / Personal Manager / Support
Hacker spoofing as GoogleBot
Page indexed but live url test gets 500 error
Link collaboration strategies
in case you missed it .
Microsoft, AS8075. Google, AS396982.
Bad actor claiming to be OpenAi
Home
Forums Index
Server Side
/
PHP Server Side Scripting
3:41 pm May 21, 2026