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 (), 17,416 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
Export floats into txt file #340981
09/09/10 10:23
09/09/10 10:23
Joined: Jul 2010
Posts: 11
Spain
S
skeu Offline OP
Newbie
skeu  Offline OP
Newbie
S

Joined: Jul 2010
Posts: 11
Spain
Hello to all,
i would like to ask if there is any possibility to export the floats with all decimals?

Thanks in advance laugh

Re: Export floats into txt file [Re: skeu] #341087
09/10/10 15:03
09/10/10 15:03
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
I assume that this is a possibility:
file_str_write(file_handle, str_for_float(NULL, 12.345678));

Re: Export floats into txt file [Re: Saturnus] #341203
09/13/10 08:54
09/13/10 08:54
Joined: Jul 2000
Posts: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
Frankfurt
The best method for exporting floats is just writing them binary into a file, f.i.

float myfloat = 3.14;
file_str_write(handle,(char*)&myfloat,4);


The second-best method is writing them as ASCII like Saturnus suggested, or using the str_printf function.


Moderated by  old_bill, Tobias 

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