Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Print TO_CSV having comma as decimal separator #479723
04/20/20 14:41
04/20/20 14:41
Joined: Sep 2018
Posts: 29
K
kerplunk1899 Offline OP
Newbie
kerplunk1899  Offline OP
Newbie
K

Joined: Sep 2018
Posts: 29
Hi guys,
is there a way to export data using print(TO_CSV, "...", ...) , and generating values with comma as decimal separator instead of dot?
I tried to change the option in the ini config file but it doesn't seem to work for this case.

Thanks in advance.

Re: Print TO_CSV having comma as decimal separator [Re: kerplunk1899] #479727
04/20/20 16:42
04/20/20 16:42
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
I believe changing the Comma setting in the ini file only affects these exported CSV files and not TO_CSV:
https://zorro-project.com/manual/en/export.htm

So it sounds like the solution is to manually reformat the strings to European format before you issue them to TO_CSV.

Re: Print TO_CSV having comma as decimal separator [Re: AndrewAMD] #479735
04/21/20 09:43
04/21/20 09:43
Joined: Sep 2018
Posts: 29
K
kerplunk1899 Offline OP
Newbie
kerplunk1899  Offline OP
Newbie
K

Joined: Sep 2018
Posts: 29
Thank you Andrew, about the ini file that's what i guessed.
Can you give me a few more details about the strings format and how to change it?
I haven't been able to find anything on the manual.
Thank you so much.

Re: Print TO_CSV having comma as decimal separator [Re: kerplunk1899] #479737
04/21/20 14:17
04/21/20 14:17
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
I assume you know how to create a regular CSV with TO_CSV and how C strings work.

First, you construct your string with sprintf or strf, but with semicolons instead of commas as separators. Each var will have periods for decimal places.

Next, you iterate through each character of your string and replace each '.' with ','.

Finally, you push the string to print(TO_CSV,...).

Re: Print TO_CSV having comma as decimal separator [Re: kerplunk1899] #479746
04/22/20 10:35
04/22/20 10:35
Joined: Sep 2018
Posts: 29
K
kerplunk1899 Offline OP
Newbie
kerplunk1899  Offline OP
Newbie
K

Joined: Sep 2018
Posts: 29
Ok I thought there existed some standard function.
Anyway I made it. I used strxc to replace the dots.
Thanks!!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1