custom format for decimal c#
问题 I'm trying to format a decimal value with decimals to a custom format without comas or points , Having checking http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx but can't find the format I need I need to convert a decimal value for example 3.1416 to 314 or even better 0000000314, any clue? 回答1: To scale by 100 and show up to 9 leading zeros use String.Format("{0:0000000000}", (value * 100)); 回答2: For just display String.Format("{0:##########}", (value * 100)) 回答3: Make a simple Method