Forum Discussion
iwannabfishn
Feb 28, 2023Copper Contributor
Format a number column to contain 3 numbers
 I have a number column in sharepoint online that contains (1,10, and 100). I need this to show as (001, 010, and 100). How can I format this column to display these leading 0s?  Thanks! 
- Feb 28, 2023
You cannot do it with datatype Number. You can create a calculated column and then append 0 or 00 to the beginning.
Example: NumberColumn is the column with type Number
and CalNumber is the calculated column with type Text. Here is the formula for the calculated column:
=IF(LEN(NumberColumn)=1,"00"&NumberColumn,IF(LEN(NumberColumn)=2,"0"&NumberColumn))
If my response helped you, please Like and Mark as Best Response.
 
iwannabfishn
Mar 01, 2023Copper Contributor
Not to complicate this too much. But, my text formatted column actually sorted correctly in our old 2010 sharepoint server. It stopped working when we moved to sharepoint online. I was thinking the issue was because it was text and not a number, but the fix was to index this column. This is a large library (~15,0000 files). Once I indexed the column, now it will sort the ascending/descending correctly. Thank you for all the replies!