Hi.
I'm trying to get a 1 digit decimal format (ex: 102.4 or 6.0) instead of getting 2 digits (102.41 or 6.02).
What's wrong in my code?
I'm trying to get a 1 digit decimal format (ex: 102.4 or 6.0) instead of getting 2 digits (102.41 or 6.02).
protected
void
gridReport_ExcelMLExportStylesCreated(
object
source, GridExportExcelMLStyleCreatedArgs e)
{
StyleElement oneDecimalStyle =
new
StyleElement(
"oneDecimalStyle"
);
oneDecimalStyle.NumberFormat.FormatType = NumberFormatType.Fixed;
oneDecimalStyle.NumberFormat.Attributes[
"ss:Format"
] =
"0/.0"
;
e.Styles.Add(oneDecimalStyle);
}
protected
void
gridReport_ExcelMLExportRowCreated(
object
source, GridExportExcelMLRowCreatedArgs e)
{
if
(e.RowType == GridExportExcelMLRowType.DataRow)
{
CellElement cell = e.Row.Cells.GetCellByName(
"airDuration"
);
cell.StyleValue =
"oneDecimalStyle"
;
}
}
What's wrong in my code?