Exemplo n.º 1
0
        public void Convert_ReturnNumber()
        {
            NumberToWord n2w;

            n2w = new NumberToWord("0");

            Assert.AreEqual("one thousand one hundred twenty-three", n2w.Convert("1123"));
            Assert.AreEqual("twenty-one thousand one hundred", n2w.Convert("21100"));
            Assert.AreEqual("three hundred twenty-one thousand one hundred one", n2w.Convert("321101"));
            Assert.AreEqual("four million three hundred twenty-one thousand one hundred ten", n2w.Convert("4321110"));
            Assert.AreEqual("one", n2w.Convert("1"));
            Assert.AreEqual("ten", n2w.Convert("10"));
        }
Exemplo n.º 2
0
        public ActionResult Result()
        {
            Dictionary <string, object> model = new Dictionary <string, object>();

            model.Add("num", Request.Form["number"]);
            model.Add("str", NumberToWord.Convert(Request.Form["number"]));
            return(View("Result", model));
        }
Exemplo n.º 3
0
 public ActionResult Result()
 {
     return(View("Result", NumberToWord.Convert(Request.Form["number"])));
 }