예제 #1
0
        public void Test_SplitDecimal_0_12()
        {
            var options = new NumberToTextOptions
            {
                Currency = Currency.PLN
            };

            Assert.Equal("zero zlotych dwanascie groszy", NumberToText.Convert(0.12M, options));
        }
예제 #2
0
        public void Test_SplitDecimal_50_50()
        {
            var options = new NumberToTextOptions
            {
                SplitDecimal = "i"
            };

            Assert.Equal("piecdziesiat i piecdziesiat", NumberToText.Convert(50.50M, options));
        }
예제 #3
0
        private string CreateAmountInWords()
        {
            var options = new NumberToTextOptions
            {
                Stems    = true,
                Currency = Currency.PLN
            };

            return(NumberToText.Convert(Convert.ToDecimal(_grossSum, _culture), options));
        }
예제 #4
0
        public void Test_SplitDecimal_12_02()
        {
            var options = new NumberToTextOptions
            {
                Currency     = Currency.PLN,
                SplitDecimal = " oraz "
            };

            Assert.Equal("dwanascie zlotych  oraz  dwa grosze", NumberToText.Convert(12.02M, options));
        }
예제 #5
0
        public void Test_SplitDecimal_12_23()
        {
            var options = new NumberToTextOptions
            {
                Currency     = Currency.PLN,
                SplitDecimal = "i"
            };


            Assert.Equal("dwanascie zlotych i dwadziescia trzy grosze", NumberToText.Convert(12.23M, options));
        }
예제 #6
0
        public void Test_SplitDecimal_5_5()
        {
            var options = new NumberToTextOptions
            {
                Currency     = Currency.PLN,
                SplitDecimal = "i"
            };


            Assert.Equal("piec zlotych i piecdziesiat groszy", NumberToText.Convert(5.5M, options));
        }
예제 #7
0
        public object Evaluate(params object[] operands)
        {
            var options = new NumberToTextOptions
            {
                Stems    = true,
                Currency = Currency.PLN,
            };
            var     kwotaStr = operands[0];
            decimal kwota    = Decimal.Parse(kwotaStr.ToString());

            string res = NumberToText.Convert(kwota, options);;

            return(res);
        }
예제 #8
0
        public DaneTabela RazemSlownie()
        {
            var sum  = s_MListDt.First();
            var nTto = new NumberToTextOptions
            {
                Currency = Currency.PLN,
                Stems    = true
            };

            var slowo = NumberToText.Convert(Convert.ToDecimal(sum.WartoscBrutto), nTto);

            return(new DaneTabela {
                Lewa = DictionaryMain.LabelSlownie, Prawa = slowo
            });
        }
예제 #9
0
        static void Main(string[] args)
        {
            //StreamReader sr = new StreamReader(@"C:\Users\Bartosz\Desktop\liczby.txt");
            //string[] liczby = new string[2501];
            //int i = 0;
            //do
            //{

            //    liczby[i] = sr.ReadLine();
            //    i++;
            //}
            //while (sr != null&&i<=2500);


            //do
            //{
            //    Console.WriteLine("podaj liczbe:");
            //    int a = int.Parse(Console.ReadLine());
            //    Console.WriteLine(liczby[a]);
            //    Console.ReadKey();

            //}
            //while (true);

            //sr.Close();

            var options = new NumberToTextOptions
            {
                Stems    = true,
                Currency = Currency.PLN,
            };

            string wynik = NumberToText.Convert(2311, options);

            Console.WriteLine(wynik);
            Console.ReadLine();
        }