That (after correcting the typo, the missing ") would give "cons_0.000010". 
The right way would be

charvar = @sprintf("cons_%.5f", 0.00001)

Am Mittwoch, 13. August 2014 13:48:40 UTC+2 schrieb Andreas Noack:
>
> One solution is to use the @sprintf macro, i.e. something like 
>  @sprintf("cons_%f, 0.00001). 
>
> Med venlig hilsen
>
> Andreas Noack
>  
>
> 2014-08-13 7:42 GMT-04:00 Charles Novaes de Santana <[email protected] 
> <javascript:>>:
>
>> Dear all,
>>
>> I would like to convert a float variable with more than 5 decimal digits 
>> to a string, but in the literal notation, not in the "logarithmic" one.
>>
>> For example, if I do:
>>
>> floatvar = 0.00001;
>> charvar = string("cost_",floatvar);
>> println(charvar);
>>
>> charvar is written as: "cost_1.0e-5". Instead of that, I would like to 
>> get "cost_0.00001".
>>
>> Any idea about how to do that? I am sorry for this very basic question, 
>> but so far I couldn't realize by myself neither find in the forums a way to 
>> do that.
>>
>> Thank you for your attention and for any help!
>>
>> Best,
>>
>> Charles
>>
>>
>> -- 
>> Um axé! :)
>>
>> --
>> Charles Novaes de Santana, PhD
>> http://www.imedea.uib-csic.es/~charles
>>  
>
>

Reply via email to