parse() static private method

static private parse ( string s ) : NumPattern
s string
return NumPattern
Exemplo n.º 1
0
        public static string toLocale(BigDecimal self, string pattern)
        {
            // get current locale
            Locale           locale = Locale.cur();
            NumberFormatInfo df     = locale.dec();

            // get default pattern if necessary
            if (pattern == null)
            {
                pattern = Env.cur().locale(Sys.m_sysPod, "decimal", "#,###.0##");
            }

            // parse pattern and get digits
            NumPattern p = NumPattern.parse(pattern);
            NumDigits  d = new NumDigits(self);

            // route to common FanNum method
            return(FanNum.toLocale(p, d, df));
        }