Re: Digit Grouping in msprintf?

classic Classic list List threaded Threaded
1 message Options
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Digit Grouping in msprintf?

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 [[hidden email]] On Behalf Of Richard llom
Sent: Friday, November 17, 2017 5:12 PM
To: [hidden email]
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
[hidden email]
http://lists.scilab.org/mailman/listinfo/users