Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic cell data keep leading 0s (Read 343 times)
David Chiang
Junior Member
**
Offline


I Love MindFusion!

Posts: 57
Joined: Apr 15th, 2020
cell data keep leading 0s
May 6th, 2021 at 4:38am
Print Post  
Hello,

Sorry to ask a simple question. I try to search the answer but no luck. Thanks in advance. How to keep format number as string to keep the leading 0s. When insert data in the cell, it will truncate the leading 0s and leave only rest of number in the cell.

Thanks

David Chiang
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 2532
Joined: Oct 19th, 2005
Re: cell data keep leading 0s
Reply #1 - May 6th, 2021 at 7:04am
Print Post  
Hi,

You could set cell's Style.Format to something like "00000.000" to show a fixed number of leading and trailing zeros. It might be possible to count entered zeros in InplaceEditEnding event handler to set format automatically if you'd like to preserve them exactly. Users could also start a numeric value with ' as in Excel to treat it as text, which will preserve exactly entered string, but then won't be able to use it in formulas.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
David Chiang
Junior Member
**
Offline


I Love MindFusion!

Posts: 57
Joined: Apr 15th, 2020
Re: cell data keep leading 0s
Reply #2 - May 7th, 2021 at 5:07am
Print Post  
Got it, Thanks

David Chiang
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint