I am trying to format a string using string.Format method to produce a fixed decimal string from an int data type.
I have tried following code :
sOutputString = string.Format(
"Days:{0:D1} Hours:{1:D1} Minutes:{2:D1} Seconds:{3:D1} Miliseconds:{4:D1}",
objTimeCalculate.Days,
objTimeCalculate.Hours,
objTimeCalculate.Minutes,
objTimeCalculate.Seconds,
objTimeCalculate.Miliseconds);
The values of the properties Days, Hours, Minutes, Seconds are int data type and formatted using the D format specified. However I need decimal values produced in the string.
Output should be :
sOutputString = Days : double_value Hours : double_value Minutes : double_value Seconds : double_value Miliseconds : integer_value
Since the property days can go beyond reach of the integer datatypes reach.