Exemplo n.º 1
0
        public void DoubleToString()
        {
            Assert.AreEqual("17,6", StringConversion.DoubleToString(17.6, new ValueFormat()
            {
                GroupSeparator   = ".",
                DecimalSeparator = ",",
                NumberFormat     = "#,####.0"
            }));
            Assert.AreEqual("1.237,6", StringConversion.DoubleToString(1237.6, new ValueFormat()
            {
                GroupSeparator   = ".",
                DecimalSeparator = ",",
                NumberFormat     = "#,####.0"
            }));

            Assert.AreEqual("17,6", StringConversion.DecimalToString(17.6m, new ValueFormat()
            {
                GroupSeparator   = ".",
                DecimalSeparator = ",",
                NumberFormat     = "#,####.0"
            }));
            Assert.AreEqual("1.237,6", StringConversion.DecimalToString(1237.6m, new ValueFormat()
            {
                GroupSeparator   = ".",
                DecimalSeparator = ",",
                NumberFormat     = "#,####.0"
            }));
        }
Exemplo n.º 2
0
        public void DoubleToString()
        {
            Assert.AreEqual("1.237,6",
                            StringConversion.DoubleToString(1237.6, new ImmutableValueFormat(DataType.Double, groupSeparator: ".", decimalSeparator: ",", numberFormat: "#,####.0")));

            Assert.AreEqual("17,6",
                            StringConversion.DoubleToString(17.6, new ImmutableValueFormat(DataType.Double, groupSeparator: ".", decimalSeparator: ",", numberFormat: "#,####.0")));
        }