public int[] CharsToPoints(char[] letterArray) { int[] pointArray = new int [letterArray.Length]; for (int i = 0; i < letterArray.Length; i++) { bool hasValue = WordValues.TryGetValue(letterArray[i], out int value); if (hasValue) { int points = value; pointArray[i] = points; } else { pointArray[i] = 0; } } return(pointArray); }
public ActionResult Proforma(int id) { decimal total_price = 0; var order = _stock.ResponseOrdersByCode(id.ToString()); var product = _sales.PrintProduct(id.ToString()); WordValues wordValues = new WordValues(); foreach (var item in product) { total_price += item.Amount; } int val = Convert.ToInt32(total_price); ViewBag.ValueInWords = wordValues.NumberToWords(val); OrdersViewModels viewModels = new OrdersViewModels() { ResponseOrders = order, Product = product }; var report = new PartialViewAsPdf("Proforma", viewModels); return(report); }
public int[] SampleTest(string[] a) => WordValues.WordValue(a);