[Scilab-users] number od decimals with csvWrite

Станислав krotersv at gmail.com
Fri Jun 26 14:38:27 CEST 2015


Hi.
I suppose no need to use the round function. Use csvWrite:

A=rand(3,3);

csvWrite(A, 'file_with_A_data.txt', ' ', '.', "%.2e")

7.26e-01 2.32e-01 8.83e-01
1.99e-01 2.31e-01 6.53e-01
5.44e-01 2.16e-01 3.08e-01

By the way, if you want to use a comma as a decimal mark the fourth 
parameter should be ',':

csvWrite(A, 'file_with_A_data.txt', ' ', ',', "%.2e")


Stanislav


26.06.2015 12:09, Serge Steer пишет:
> The simplest way is to use round
>
> A=rand(3,3);
> B=round(100*A)/100;
>
> Serge Steer
> Le 25/06/2015 22:07, Simone Meroni a écrit :
>> Hi
>> I want to write some data and export them with
>>
>> csvWrite
>>
>> I need to have no more than 2 decimals for aesthetic reasons.
>>
>> How can I set the number of decimals?
>>
>> Thanks,
>>
>> Simone Meroni
>>
>>
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20150626/56dd75b4/attachment.htm>


More information about the users mailing list