Ejemplo n.º 1
0
        public static DecimalFormat createLocalizedDecimalFormat(string paramString)
        {
            DecimalFormat decimalFormat1 = (DecimalFormat)DecimalFormat.getInstance(s_defaultLanguage).clone();

            decimalFormat1.applyPattern(paramString);
            return(decimalFormat1);
        }
Ejemplo n.º 2
0
        public static DecimalFormat createLocalizedDecimalFormat()
        {
            DecimalFormat decimalFormat1 = (DecimalFormat)DecimalFormat.getInstance(s_defaultLanguage).clone();

            decimalFormat1.applyPattern(CurrentPattern);
            return(decimalFormat1);
        }
Ejemplo n.º 3
0
 public static DecimalFormat getCurrencyDecimalFormat(bool paramBoolean)
 {
     if (currencyDecimalFormat == null || paramBoolean == true)
     {
         currencyDecimalFormat = (DecimalFormat)NumberFormat.getNumberInstance(s_defaultLanguage).clone();
         currencyDecimalFormat.applyPattern(CurrentPattern + " ¤");
         decimalFormat = (DecimalFormat)NumberFormat.getNumberInstance(s_defaultLanguage).clone();
         decimalFormat.applyPattern(CurrentPattern);
     }
     else if (hasPatternChanged())
     {
         currencyDecimalFormat.applyPattern(CurrentPattern + " ¤");
         decimalFormat.applyPattern(CurrentPattern);
     }
     return(currencyDecimalFormat);
 }
Ejemplo n.º 4
0
        public static string doubleToScientificString(double number, int fractionDigits)
        {
            DecimalFormat decimalFormat = new DecimalFormat();
            StringBuilder stringBuilder = new StringBuilder(5 + fractionDigits).append("0.");

            for (int i = 0; i < fractionDigits; i++)
            {
                stringBuilder.append('0');
            }
            stringBuilder.append("E00");
            decimalFormat.applyPattern(stringBuilder.toString());
            string text = decimalFormat.format(number);
            int    num  = String.instancehelper_indexOf(text, 69);

            if (String.instancehelper_charAt(text, num + 1) != '-')
            {
                return(new StringBuilder().append(String.instancehelper_substring(text, 0, num + 1)).append('+').append(String.instancehelper_substring(text, num + 1)).toString());
            }
            return(text);
        }
Ejemplo n.º 5
0
        private void loadUI()
        {
            JPanel jPanel = new JPanel();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.text.DecimalFormat decimalFormat = (java.text.DecimalFormat)java.text.DecimalFormat.getInstance(java.util.Locale.ENGLISH).clone();
            DecimalFormat decimalFormat = (DecimalFormat)DecimalFormat.getInstance(Locale.ENGLISH).clone();

            decimalFormat.applyPattern("0");
            this.o_progressBar = new JProgressBar(0, this.o_totalTimes);
            this.o_progressBar.StringPainted = true;
            this.o_descriptionLabel          = new JLabel();
            this.o_progressBar.addChangeListener(new ChangeListenerAnonymousInnerClass(this, decimalFormat));
            jPanel.Border = BorderFactory.createEmptyBorder(10, 0, 0, 0);
            jPanel.Layout = new BoxLayout(jPanel, 1);
            jPanel.add(this.o_descriptionLabel);
            jPanel.add(Box.createVerticalStrut(5));
            jPanel.add(this.o_progressBar);
            jPanel.add(Box.createVerticalStrut(5));
            this.o_mainPanel.Border = BorderFactory.createEmptyBorder(8, 8, 8, 8);
            this.o_mainPanel.add(jPanel, "Center");
        }