SpreadJS Documentation
FormatMode Enumeration
Represents the format mode.
Members
MemberDescription
CustomModeIndicates whether to format the value with the Excel-compatible format string.
StandardDateTimeModeIndicates whether to format the value with the standard date-time format.
StandardNumericModeIndicates whether to format the value with the standard numeric format.
Example
This example uses the FormatMode enumeration.
var dvalue= 12345.6789; 
var nvalue = 12345; 
activeSheet.setColumnWidth(0, 100); 
activeSheet.setColumnWidth(1, 100); 
activeSheet.setColumnWidth(2, 100); 
activeSheet.setValue(0,0,dvalue); 
activeSheet.getCell(0, 0).formatter(new GcSpread.Sheets.GeneralFormatter("c3", GcSpread.Sheets.FormatMode.StandardNumericMode)); 
activeSheet.getCell(0, 1).formatter(new GcSpread.Sheets.GeneralFormatter("E", GcSpread.Sheets.FormatMode.StandardNumericMode)); 
activeSheet.setValue(0,1,dvalue); 
activeSheet.getCell(0, 2).formatter(new GcSpread.Sheets.GeneralFormatter("f", GcSpread.Sheets.FormatMode.StandardNumericMode)); 
activeSheet.setValue(0,2,dvalue); 
activeSheet.getCell(1, 0).formatter(new GcSpread.Sheets.GeneralFormatter("N", GcSpread.Sheets.FormatMode.StandardNumericMode)); 
activeSheet.setValue(1,0,dvalue); 
activeSheet.getCell(1, 1).formatter(new GcSpread.Sheets.GeneralFormatter("g2", GcSpread.Sheets.FormatMode.StandardNumericMode)); 
activeSheet.setValue(1,1,dvalue); 
activeSheet.getCell(1, 2).formatter(new GcSpread.Sheets.GeneralFormatter("p", GcSpread.Sheets.FormatMode.StandardNumericMode)); 
activeSheet.setValue(1,2,dvalue); 
activeSheet.getCell(2, 0).formatter(new GcSpread.Sheets.GeneralFormatter("r", GcSpread.Sheets.FormatMode.StandardNumericMode)); 
activeSheet.getCell(2, 0).value(Math.PI); 
activeSheet.getCell(2, 1).formatter(new GcSpread.Sheets.GeneralFormatter("x", GcSpread.Sheets.FormatMode.StandardNumericMode)); 
activeSheet.setValue(2, 1,nvalue); 
activeSheet.getCell(2, 2).formatter(new GcSpread.Sheets.GeneralFormatter("D8", GcSpread.Sheets.FormatMode.StandardNumericMode)); 
activeSheet.setValue(2,2,nvalue);
Inheritance Hierarchy

Object
   GcSpread.Sheets.FormatMode

See Also

Reference

GcSpread.Sheets Namespace

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.