Text format of textbox

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

Text format of textbox

Postby rick.ben15 » 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

Re: Text format of textbox

Postby iceblue support » 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: 244
Joined: Tue Dec 21, 2010 2:56 am


Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 0 guests