[Scilab-users] String and integer

Jean-Yves Baudais Jean-Yves.Baudais at insa-rennes.fr
Fri Nov 20 15:08:48 CET 2020


Hi,
  A solution, of course not the best,
--> if i<10, s=msprintf("000%d",i) end
with iteration for high number, or with 3-floor(log10(i)) added zeros?

--Jean-Yves

----- Original Message -----
> From: "paul francedixhuit" <paul18fr at gmail.com>
> To: "Users mailing list for Scilab" <users at lists.scilab.org>
> Sent: Friday, 20 November, 2020 14:48:46
> Subject: [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

-- 
--
Jean-Yves Baudais



More information about the users mailing list