Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 05:41
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AbrahamR, AndrewAMD), 1,278 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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 | chip programmers | 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