Declare the var a double
In the printf (sprintf whatever) use %.2f
Example
double rooms = top_room,
percent = (double)rcnt / (rooms / 100);
printf_to_char( ch, "Thats %.2f%% of the world.\n\r",percent);
Cheers,
-----Original Message-----
From: Tristan M [mailto:[EMAIL PROTECTED]
Sent: Monday, May 10, 2004 12:04 PM
To: [email protected]
Subject: using decimals in ROM
is there any way to use decimals in ROM? it seems to always round my
values, but for some things it would be really nice to be able go to 2
decimal places, is there a way?
_________________________________________________________________
MSN Premium includes powerful parental controls and get 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU
=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom