Menu

set Locale number formats - help

Help
gluckino
2004-09-01
2013-04-29
  • gluckino

    gluckino - 2004-09-01

    Maybe it is a trivial question, but I can't set locale number formats to European format, that is thousands separated by "." and decimals by "," (i.e.  1.423,56).

    I've already verified the correct setting in 'Regional Options" on server and tried to modify the formatString in xml file as "#.###,00" but without success.

    Could someone explain what to do such as Jpivot can use Locale setting ?

    Thanks in advance,

    gluckino 

     
    • Andreas Voss

      Andreas Voss - 2004-09-01

      You should get german formatting if your preferred browser language is german.

       
    • gluckino

      gluckino - 2004-09-02

      Thank you Andreas,

      but I need a more detail answer. What does you mean with "get german formatting ..." ?

      Every suggestion is appreciated.

      Thank you.

      gluckino

       
    • Ati Rosselet

      Ati Rosselet - 2004-09-09

      german formatting is European, as you  needed.  If you need a different number format etc.  I think you need to go back and change the Locale class in Mondrian itself, and define a new default, or new language-dependant (e.g. chinese or something).
      Cheers.

      P.S.  I seem to remember something about IE and other browsers reporting the locale from the browsers differently, some with en_US and some with just "en" or just "US" or something.. but don;t quote me on this..

       
    • gluckino

      gluckino - 2004-09-09

      Hello Ati,
      my pain is to visualize a measure with an European  format as "#.###,00".
      I  woild like to know steps necessary to specify to JPivot (or Mondrian) of accepting that format.

      Thanks in advance,

      gluckino

       
    • Andrew

      Andrew - 2004-09-26

      I had the same problem for italian locale. Open the source of mondrian.util.Format class. Find the static initialization of localeGer, copy it and paste it in the row after. Modify the associated locale as you need. Here i put my change.
       
        ......
        // This is the german initialization
        static final FormatLocale localeGer = createLocale(
          '.', // thousandSeparator = ',' in en
          ',', // decimalPlaceholder = '.' in en
          ".", // dateSeparator = "/" in en
          ":", // timeSeparator = ":" in en
          "EUR", // currencySymbol = "$" in en
          "#.##0,00EUR", // currencyFormat = "$#,##0.##" in en
          new String[] {
            "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"},
          new String[] {
            "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag",
            "Samstag"},
          new String[] {
            "Jan", "Feb", "Mr", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep",
            "Okt", "Nov", "Dez"},
          new String[] {
            "Januar", "Februar", "Mrz", "April", "Mai", "Juni",
            "Juli", "August", "September", "Oktober", "November",
            "Dezember"},
          Locale.GERMAN);

        // This is the italian initialization i've added
      static final FormatLocale locale_IT = createLocale(
            '.', // thousandSeparator = ',' in en
            ',', // decimalPlaceholder = '.' in en
            "/", // dateSeparator = "/" in en
            ":", // timeSeparator = ":" in en
            "EUR", // currencySymbol = "$" in en
            "#.##0,00EUR", // currencyFormat = "$#,##0.##" in en
            new String[] {
              "Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa"},
            new String[] {
              "Domenica", "Luned", "Marted", "Mercoled", "Gioved", "Venerd",
              "Sabato"},
            new String[] {
              "Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set",
              "Ott", "Nov", "Dic"},
            new String[] {
              "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno",
              "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre",
              "Dicembre"},
            Locale.ITALIAN);

      compile the class and put it in the mondrian.jar.

      Andrea

       
      • Ati Rosselet

        Ati Rosselet - 2004-09-26

        bingo.. thats the one.. I had to do the exact same thing for hungarian.  Alternatively you can also set a different language as default...  :)

         
    • gluckino

      gluckino - 2004-10-01

      Andrew,
      your solution is OK. It solves my problem.

      Thank you very much.

      gluckino

       

Log in to post a comment.