View Full Version : Trim
Freon22
01-11-2006, 04:51 AM
Hi,
I have a little problem
The below code works find for me but if it ends with a .01 or anything other the .00 I get it in the print out
<%
Dim MyVar
MyVar = 1000000
Replace(FormatNumber(MyVar), ".00", "")
%>
Is there a way to trim everthing from the .
Thanks
glenngv
01-11-2006, 05:02 AM
FormatNumber (http://www.devguru.com/technologies/vbscript/13926.asp)(Int (http://www.devguru.com/technologies/vbscript/13936.asp)(MyVar), 0)
Freon22
01-11-2006, 05:12 AM
Thanks, it work great :)
lovesirius12
01-12-2006, 12:27 AM
<%
Dim MyVar
MyVar = 1000000
Replace(FormatNumber(MyVar), ".00", "")
%>
<%
Dim MyVar
MyVar = 1000000
Replace(FormatNumber(MyVar), "00", "")
%>
Freon22
01-12-2006, 03:50 AM
Thanks for the reply lovesirius, but glenngv method is the best in this case. If only whole numbers where being inputed into the database then the replace function would work. But sometimes I will have a whole number with a .1254 or something like that. So anyway you can see why the replace function wouldn't work for me. I do want to thank you for the reply.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.