Format in the text
The Text Format tool allows you to format values using a lot of parameters and options. But this tool has one weak point. Formatting is applied on the whole text object. For example, if the text component is used for data output then there is no problems with formatting. But what can you do if you want to format only one value from an expression? Or what can you do if you want to format two or more values of expression? In this case we recommend you use the string.Format method. Using this method you can make almost the same kinds of formatting as if you use the Text Format tool. But the string.Format method has much flexibility. For example, if you want to format the value as a currency you should use the С specificator:
Currency values: {string.Format(“{0:C}”, Value) }
if the Value is 123.12 then after calculation you will get the following line:
Currency values: $123.12
Also the string.Format method takes more than one parameter for formatting. For example:
Currency values: {string.Format(“value1 - {0:C}, value2 - {0: 1}”, Value1, Value2) }
You can find more information of the string.Format method in MSDN.