Thanks, that seems to work.
Still it amazes me how Julia, being a language made for numerical 
calculations, does not natively support a simple mechanism to print/write 
large bunches of numbers. I've been in the numerical world for 20+ years 
and I know printing lots of numbers is something you get on a daily
basis. I know now the formatting package can help on that (thanks :), what 
I do not like is the idea of having to install every time a new package
to get added functionality. I understand there are things that have to go 
to external packages because of its limited or specialized use, but
come on... printing number os definitely not one of those.
Just my 2cents :)

On Monday, September 21, 2015 at 10:52:52 AM UTC+2, Michael Hatherly wrote:
>
> https://github.com/JuliaLang/Formatting.jl might help.
>
> — Mike
> ​
> On Monday, 21 September 2015 10:46:31 UTC+2, Ferran Mazzanti wrote:
>>
>> Dear all,
>>
>> I could use some help here, because I can't believe I'm not able to 
>> easily print formatted numbers under Julia in a easy way. What I try to do 
>> is to write a function that, given a vector, prints all its components with 
>> a user-defined format. I was trying something of the form
>>
>> function Print_Vec(aux_VEC,form_VEC)
>>     form_VEC :: ASCIIString
>>     str_VEC  = "%16.8f"
>>     for elem_VEC in aux_VEC
>>         str_VEC += @sprintf(form_VEC,elem_VEC)
>>     end
>>     return str_VEC
>> end
>>
>> However, that doesn't work because it looks like the first argument in 
>> @sprintf must be a explicit string, and not a variable.
>> Is there anything I can do with that?
>>
>> Thanks a lot for your help.
>>
>

Reply via email to