Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Tue Dec 28, 2010 1:33 am

Hi experts,

I have a textbox with fixed length of 13. Now what I want to do is that if I enter 12345 the text should change to
0000001234500 (6 zeros + value + 2 zeros)), last 2 digit is for decimal value and the remaining 6 digit should be replace by
leading zeros. and if I enter 1234 than value should be 0000000123400 (7 zeros + value + 2 zeros).

Thanks

rick.ben15
 
Posts: 4
Joined: Tue Dec 28, 2010 1:13 am

Tue Dec 28, 2010 10:09 am

int a = txtabc.Length;
string strFirst="";
for(int i=0;i<13-a;i++)
{
strFirst+="0";
}

txtabc.Text = strFirst+ txtabc.Text;


8)
e-iceblue support
User avatar

iceblue support
 
Posts: 240
Joined: Tue Dec 21, 2010 2:56 am

Return to Spire.XLS