my maxhp function returns 6666.0000
i just need the 6666, how do you remove that in lua?
thanx in advance ^.^
botje
removing numbers after decimal.
Forum rules
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
This is a sub-forum for things specific to MicroMacro.
This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
- MiesterMan
- Posts: 543
- Joined: Tue Jul 06, 2010 9:15 pm
- Location: Between the Second and Third Circles of Hell
Re: removing numbers after decimal.
I know how to do that in C++ for outputting to a printf, not sure if it works the same with lua.
http://www.lua.org/manual/5.1/
If it is the same than you put a .0 after it like:
http://www.lua.org/manual/5.1/
If it is the same than you put a .0 after it like:
Code: Select all
printf("You have %.0f hp.\n",hpFloat);
My RoM Bot toys:
- Object Viewer: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2619
Teleporter Functions: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2605
Waypoint Finder: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2616
Mail Functions: http://www.solarstrike.net/phpBB3/viewt ... =27&t=2612
Equipment Swapper(TempFixed): http://www.solarstrike.net/phpBB3/viewt ... =27&t=2571
Re: removing numbers after decimal.
awww... didnt work 

- Administrator
- Site Admin
- Posts: 5329
- Joined: Sat Jan 05, 2008 4:21 pm
Re: removing numbers after decimal.
Try this:
%d will give you a whole number. %f will give you floating-point integers.
Code: Select all
printf("%d\n", someNumber);
Re: removing numbers after decimal.
thanx admin, that worked great ^^
Who is online
Users browsing this forum: No registered users and 1 guest