Corrected version:

// START OF CODE
n = 2725977;
p = int(log10(n)/3)*3;
x=[];
for i=p:-3:0;
    x = [x int(n/10^i)];
    n=modulo(n,10^i);
end
// END OF CODE



Regards,

Rafael



-----Original Message-----
From: users [mailto:[email protected]] On Behalf Of Richard llom
Sent: Friday, November 17, 2017 5:12 PM
To: [email protected]<mailto:[email protected]>
Subject: Re: [Scilab-users] Digit Grouping in msprintf?



Hi Samuel,

I need the number in "kWh", but no digits after the comma.



Postprocessing with strcat(s," ") is a nice idea.

Is there a function to split the number to the power of 10 factors?

Eg. 2725977 becomes

[2 , 725 , 977]



Then it would be really easy. :-)

Thanks

richard


_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to