SpreadJS 13
GC.Spread.Common Namespace / CultureInfo type / NumberFormat Field
In This Topic
    NumberFormat Field
    In This Topic
    Indicates all the number format fields.
    var instance = new GC.Spread.Common.CultureInfo();
    var value; // Type: Object
    value = instance.NumberFormat;
    var NumberFormat : Object;
    // This example creates a custom culture.
    var myCulture = new GC.Spread.Common.CultureInfo();
    myCulture.NumberFormat.currencySymbol = "\u20ac"
    myCulture.NumberFormat.numberDecimalSeparator = ",";
    myCulture.NumberFormat.numberGroupSeparator = ".";
    myCulture.NumberFormat.arrayGroupSeparator = ";";
    myCulture.NumberFormat.arrayListSeparator = "\\";
    myCulture.NumberFormat.listSeparator = ";";
    myCulture.DateTimeFormat.amDesignator = "";
    myCulture.DateTimeFormat.pmDesignator = "";
    myCulture.DateTimeFormat.abbreviatedMonthNames = ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""];
    myCulture.DateTimeFormat.abbreviatedDayNames = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"];
    myCulture.DateTimeFormat.abbreviatedMonthGenitiveNames = ["Jan", "Feb", "Mrz", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez", ""];
    myCulture.DateTimeFormat.dayNames = ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"];
    myCulture.DateTimeFormat.fullDateTimePattern = "dddd, d. MMMM yyyy HH:mm:ss";
    myCulture.DateTimeFormat.longDatePattern = "dddd, d. MMMM yyyy";
    myCulture.DateTimeFormat.longTimePattern = "HH:mm:ss";
    myCulture.DateTimeFormat.monthDayPattern = "dd MMMM";
    myCulture.DateTimeFormat.monthNames = ["Januar", "Februar", "M\xe4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""];
    myCulture.DateTimeFormat.monthGenitiveNames = ["Januar", "Februar", "M\xe4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""];
    myCulture.DateTimeFormat.shortDatePattern = "dd.MM.yyyy";
    myCulture.DateTimeFormat.shortTimePattern = "HH:mm";
    myCulture.DateTimeFormat.yearMonthPattern = "MMMM yyyy";
    //add one culture
    GC.Spread.Common.CultureManager.addCultureInfo("de-DE", myCulture);
    //switch to "de-DE" culture
    var d = new Date();
    //With culture
    activeSheet.setValue(1, 0, new Date(d.setDate(d.getDate() + 1)));
    activeSheet.getCell(1, 0).formatter("mmm");
    var dvalue = 12345.6789;
    activeSheet.setColumnWidth(0, 200);
    activeSheet.setColumnWidth(1, 200);
    activeSheet.setColumnWidth(2, 200);
    activeSheet.setValue(0, 0, dvalue);
    activeSheet.getCell(0, 0).formatter("###,###.00");
    activeSheet.setValue(2, 0, new Date(d.setDate(d.getDate() + 1)));
    //With culture
    activeSheet.getCell(3, 0).formatter("yyyy/mmm/dddd");
    activeSheet.setValue(3, 0, new Date());
    Property Data Type Description
    currencyDecimalSeparator {string} Indicates the currency decimal point
    currencyGroupSeparator {string} Indicates the currency thousand separator
    currencySymbol {string} Indicates the currency symbol
    numberDecimalSeparator {string} Indicates the decimal point
    numberGroupSeparator {string} Indicates the thousand separator
    listSeparator {string} Indicates the separator for function arguments in a formula
    arrayListSeparator {string} Indicates the separator for the constants in one row of an array constant in a formula
    arrayGroupSeparator {string} Indicates the separator for the array rows of an array constant in a formula.
    dbNumber {object} Specifies the DBNumber characters

    The dbNumber object structure as follow:


            1: {letters: ['兆', '千', '百', '十', '亿', '千', '百', '十', '万', '千', '百', '十', ''],

                numbers: ['○', '一', '二', '三', '四', '五', '六', '七', '八', '九'] },

            2: {letters: ['兆', '仟', '佰', '拾', '亿', '仟', '佰', '拾', '万', '仟', '佰', '拾', ''],

                numbers: ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']},

            3: {letters: null,

                numbers: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']}


    See Also