Number validator with german decimal separator

Posted by: samuelstein on 8 September 2017, 10:09 am EST

  • Posted 8 September 2017, 10:09 am EST

    hello,

    i become desperate with the number validator. i want to allow integers and floats between -20.0 and 100.0. the validator is only working if i put in floats with point as decimal separator. but i want to allow comma as decimal separator because it is for a german client.

    i created also a german culture with comma as decimal separator but it is not working.

    can you please help me out?

    greetings

  • Posted 8 September 2017, 10:09 am EST

    any progress on this issue?

  • Posted 8 September 2017, 10:09 am EST

    Hello,

    I could replicate the issue wherein I created a German custom culture and it is still not working with comma as decimal separator.

    Tracking id for your issue is #241872.

    Hence, I have escalated this issue to the concerned team for further investigation. I will get back to you as soon as we hear anything from our concerned team.

    Thanks,

    Reeva

  • Posted 8 September 2017, 10:09 am EST

    Hello,

    thanks for testing and reproducing the failure. i’m looking forward to the solution. is there a temporary workaround except deactivating the validator?

  • Posted 8 September 2017, 10:09 am EST

    Hello,

    Unfortunately, we couldn’t find any workaround for the same else we would have provided you beforehand.

    We regret the inconvenience.

    Thanks,

    Reeva

  • Posted 8 September 2017, 10:09 am EST

    Anything new?

  • Posted 8 September 2017, 10:09 am EST

    Hello,

    You must be setting NumberFormat.numberDecimalSeparator = “,” i.e. number 1234567,89 is displayed as “1,234,567,89”.

    And regarding your other question wherein you want to allow integers and floats between -20.0 and 100.0, do you mean NumberValidator?

    [csharp]var dv1 = new GC.Spread.Sheets.DataValidation.createNumberValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, -20.0, 100.0, false);[/csharp]

    Please confirm.

    Thanks,

    Reeva

  • Posted 8 September 2017, 10:09 am EST

    Thanks for the example. Now the validator and the decimal separator is working.

  • Posted 8 September 2017, 10:09 am EST

    Hello,

    We are glad to know that your issue has been resolved.

    Thanks,

    Reeva

  • Posted 22 November 2017, 5:50 am EST

    so sorry. i made a mistake. the comma as decimal separator with number validation is still not working.

  • Posted 11 December 2017, 10:10 am EST

    Hello,

    I am able to replicate the issue with German culture (comma as decimal separator) and number validation. I have asked the development team to look into this issue again. I will let you know as soon as I hear anything on this.

    Thanks,

    Deepak Sharma

  • Posted 15 January 2018, 8:09 am EST

    Hello,

    It is suggested that the setDataValidator() method should be used for cell by cell not for a range a t a go. For example:

    
       $(document).ready(function () {
                var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), { sheetCount: 1 });
                var activeSheet = spread.sheets[0];
                activeSheet.setColumnCount(5);
                activeSheet.setRowCount(10);
    
                var myCulture = new GC.Spread.Common.CultureInfo();
                myCulture.NumberFormat.currencySymbol = "€"
                myCulture.NumberFormat.numberDecimalSeparator = ",";
                myCulture.NumberFormat.NumberFormatumberGroupSeparator = ".";
                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 = ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"];
                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ärz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember", ""];
                myCulture.DateTimeFormat.monthGenitiveNames = ["Januar", "Februar", "März", "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
                GC.Spread.Common.CultureManager.culture("de-DE");
                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 = 1234567.89;
                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());
    
    
                activeSheet.setValue(1, 1, 150);
                activeSheet.setValue(2, 1, 120);
                activeSheet.setValue(3, 1, 10);
                activeSheet.setValue(4, 1, 23);
                activeSheet.setFormula(2, 2, "SUBTOTAL(9,B1:B7)");
    
    
    
    
    $("#button1").click(function () {
                    spread.options.highlightInvalidData = true;
                    var dv1 = new GC.Spread.Sheets.DataValidation.createNumberValidator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between, -20.0, 100.0, false);
    activeSheet.setDataValidator(0, 0, dv1,GC.Spread.Sheets.SheetArea.viewport);
                });
     });
    
    

    Thanks,

    Deepak Sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels