Re: [Scilab-users] xstring + format decimal number.

2021-03-26 Thread Marcus Vinicius P. de Souza
Dear Christophe,
Excellent!!
Thanks a lot!!
Best regards!!
MV



--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] xstring + format decimal number.

2021-03-26 Thread Stéphane Mottelet

Hi,

Le 25/03/2021 à 18:19, Marcus Vinicius P. de Souza a écrit :

Dear all,
I am not getting to formate strings using xstring command. For example:

Mp=54.566

xstring(1,1,'$\LARGE Mp={'+string(Mp)+'}\%$')

I want only: Mp=54.56%
How do I do?
Besides this, it is possible to define some position using "xstring" only by
click in figure?
"Fontsize" command doesn't work in xstring?
Can anybody help me?


For the two last points see my answers on StackOverflow (please avoid 
cross-posting in the future):


https://stackoverflow.com/questions/66808702/xstring-format-decimal-number-scilab

S.


Best regards.




--
Sent from: 
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users


--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] xstring + format decimal number.

2021-03-26 Thread Dang Ngoc Chan, Christophe
Hello,

> De : Marcus Vinicius P. de Souza
> Envoyé : jeudi 25 mars 2021 18:20
>
> Mp=54.566
> [...]
> I want only: Mp=54.56%
> How do I do?

I suggest o use floor() (truncate) or round(), e.g.

xstring(1, 1, '$\LARGE Mp={' + string(0.01*floor(100*Mp)) + '}\%$')

or use msprintf() (rounding), e.g.

xstring(0, 1, '$\LARGE Mp={' + msprintf("%2.2f", Mp) + '}\%$')

HTH

Regards


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

General
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error), please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users