Tutorials
Community
Forums
Careers
EasyCFM.COM ColdFusion Forums
/
Coding Help!
/ int() problem
Login
Join
Search
Reply to Discussion
|
New Discussion
<<
previous
||
next
>>
Posted By
Discussion Topic: int() problem
chhchung
11-29-2004 @ 10:30 AM
Reply
Edit
Profile
Send P.M.
Powered by
Gravatar
Senior Member
Posts: 268
Joined: Jul 2003
I want to change the decimal number(38.0) to whole number (38), however, the code #int(decimalnum)# doesn't work when the decimalnum is null.
Is that anyway that i can avoid the error when decimalnum is null. Just give me a blank that's all.
Picture of the day
This message was edited by chhchung on 11-29-04 @ 12:49 PM
maquiladoras
11-29-2004 @ 10:58 AM
Reply
Edit
Profile
Send P.M.
Powered by
Gravatar
Moderator
Posts: 2073
Joined: Dec 2002
why not just use round() ?
or are you saying you want decimal places unless they end in .0?
-
"There is no justice, There is Just Us"
-
chhchung
11-29-2004 @ 11:22 AM
Reply
Edit
Profile
Send P.M.
Powered by
Gravatar
Senior Member
Posts: 268
Joined: Jul 2003
The number display in my site is end with .0 if the number is whole number.
Maybe the problem with access db. If db is empty, when you use int() it giving error. I want to avoid it.
This message was edited by chhchung on 11-29-04 @ 12:48 PM
studio
12-02-2004 @ 1:06 AM
Reply
Edit
Profile
Send P.M.
Powered by
Gravatar
New Member
Posts: 22
Joined: May 2004
if (len(decimalnum)){
result = int(decimalnum);
}
Coding Help!
-- Coding Help!
-- Application Beta Testing Area!
-- Good Coding Tips!
Other Adobe Products
-- Dreamweaver
-- Flash Development
-- Flex Development
Database Help
-- MS Access Related Issues
-- MS SQL Server Related Issues
-- MySQL Related Issues
-- Oracle Related Issues
-- Other
ColdFusion Server/Applications
-- ColdFusion Server
-- ColdFusion Applications
General Area
-- General Discussion
-- New Users Area!
-- Feedback Area
-- Site Stuff!
-- Polls
Code Conversion Help
-- ASP to CFML
-- CGI to CFML
-- .NET to CFML
-- JSP to CFML
-- PHP to CFML
ColdFusion Hosting
-- ColdFusion Hosting
EasyCFM.COM Tutorials Area
-- Tutorial Requests!
-- Bug Reports!
Free ColdFusion Hosting
-- Hosting Support
-- Requests
Developers Work Showcase!
-- Work Showcase!
ColdFusion Jobs / ColdFusion Careers
-- ColdFusion Related Jobs
Administrators & Moderators
-- Administrators & Moderators Only
--- Log In
--- Register
--- Search