[Scilab-users] String and integer
paul francedixhuit
paul18fr at gmail.com
Fri Nov 20 17:06:17 CET 2020
Based on your advices, I've fix my issue.
Thanks
Paul
###############################################
i = 1FileName = "MyFile"// PreviouslyNewFileName1 = FileName +
string(i)// NowNewFileName2 = FileName + msprintf("%.4d",i)i =
666NewFileName3 = FileName + msprintf("%.4d",i)
Le ven. 20 nov. 2020 à 15:43, CHEZE David 227480 <david.cheze at cea.fr> a
écrit :
> Hi Paul,
>
>
>
> --> msprintf("%04d",3)
>
> ans =
>
>
>
> "0003"
>
>
>
>
>
>
>
> David
>
>
>
> *De :* users <users-bounces at lists.scilab.org> *De la part de* paul
> francedixhuit
> *Envoyé :* vendredi 20 novembre 2020 14:49
> *À :* Users mailing list for Scilab <users at lists.scilab.org>
> *Objet :* [Scilab-users] String and integer
>
>
>
> Hi all
>
>
>
> In ordre to change files names, I need to convert integers into strings
> but with zeros prior to it
>
>
>
> Example if i=1 i need 0001 and not 1
>
>
>
> I don't know how to use something like "%4d" with "string"
>
>
>
> Thanks
>
>
>
> Paul
> _______________________________________________
> 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/20201120/1608260c/attachment.htm>
More information about the users
mailing list