int CDDBaseGrid::QuickSetNumber(int col, long row, int number) { // The standard set number takes double args, and one can set number of // decimal places. This convenience func just puts them together in one place. CUGCell cell; this->GetCell(col, row, &cell); cell.SetPropertyFlags( cell.GetPropertyFlags() | UGCELL_DONOT_LOCALIZE ); cell.SetNumber( (double)number ); cell.SetNumberDecimals( 0 ); cell.SetTextColor(colorBlack); this->SetCell(col, row, &cell); return UG_SUCCESS; }
int CDDBaseGrid::QuickSetNumber(int col, long row, double number, int decimals) { // This convenience func lets us set the cell value and number of decimal // places to display, in one call. if (decimals < 0 || decimals > 20 /*arbitrary*/) decimals = 3; // also arbitrary CUGCell cell; this->GetCell(col, row, &cell); cell.SetPropertyFlags( cell.GetPropertyFlags() | UGCELL_DONOT_LOCALIZE ); // stop turning period into comma for decimal pt in Gemany cell.SetNumber( number ); cell.SetNumberDecimals( decimals ); cell.SetTextColor(colorBlack); this->SetCell(col, row, &cell); return UG_SUCCESS; }