Exemple #1
0
        private string[] Split(double number)
        {
            StringBuilder pattern = new StringBuilder();

            pattern.Append("###,000.");
            for (int i = 0; i < formato.GetCasasDecimais(); i++)
            {
                pattern.Append("0");
            }

            NumberFormatInfo symbols = new NumberFormatInfo();

            symbols.NumberGroupSeparator   = ",";
            symbols.NumberDecimalSeparator = ".";

            double numberRounded = Math.Round(number, 3);

            string formatted = numberRounded.ToString(pattern.ToString(), symbols);

            return(formatted.Split('.'));
        }
Exemple #2
0
 public int GetCasasDecimais()
 {
     return formato.GetCasasDecimais();
 }