Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,008 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Divide a number in A7 Lite-c #145854
08/04/07 22:50
08/04/07 22:50
Joined: Jun 2006
Posts: 214
Germany, NRW
T
TheThinker Offline OP
Member
TheThinker  Offline OP
Member
T

Joined: Jun 2006
Posts: 214
Germany, NRW
Argh,
I need your help. Input numbers: m = 256 / 384; The result should be 0,667 but the : str_for_num(debug1,m) says "0". Is there a special way zo divide numbers?
The same for 1 / 4 and so on. I cant divide numbers.
Thank you,
Patrick

Last edited by TheThinker; 08/04/07 22:50.
Re: Divide a number in A7 Lite-c [Re: TheThinker] #145855
08/04/07 23:47
08/04/07 23:47
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
yes, you can divide numbers. there's nothing wrong with the way you're doing it. there's just something wrong with str_for_num, i'd assume, or the way you're using it, but i can't tell with what little info i can see from here. my personal recommendation is that when you want to see the output of a variable, make a panel use the variable, not a string, unless you want to write to a file or have typed user input or something. strings can be quite frustrating or tedious, and from what i can see you don't need to use them.

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: Divide a number in A7 Lite-c [Re: JibbSmart] #145856
08/05/07 08:27
08/05/07 08:27
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Will work if you write in this way : m = 256.0/384.0

Re: Divide a number in A7 Lite-c [Re: vlau] #145857
08/05/07 12:58
08/05/07 12:58
Joined: Aug 2005
Posts: 1,230
M
MichaelGale Offline
Serious User
MichaelGale  Offline
Serious User
M

Joined: Aug 2005
Posts: 1,230
Well it depends on the datatype of "m". It should be float or double if you want to store decimals.


Your friendly mod is at your service.

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1