I'm trying to set a cell with custom number format code [hh]:mm:ss so that the visible value always follows an hr:min:sec format. The cell value is set to a string which is in this format (for example, "12:00:00"). Everything seems to work until the hours value is greater than 24.
Here's the code I'm using to create the spreadsheet:
![Image]()
What can I do to get this to display like I want?
Here's the code I'm using to create the spreadsheet:
for(int i = 0; i < output.Count; i++)
{
newCol.Cell(ExcelRowStart + i).Value = output[i];
if (Regex.Match(output[i], "\\d{2,}.\\d{2,}.\\d{2,}").Success)
{
newCol.Cell(ExcelRowStart + i).Style.NumberFormat.Format = "[hh]:mm:ss";
}
}
Here's an image of the result where I increment the hour value by 1 for each row:
What can I do to get this to display like I want?