public static MvcHtmlString AppTextboxDecimal(this HtmlHelper htmlHelper, string name, object value, object htmlAttributes) { if (value != null) { if (NumUtil.IsNumeric(value)) { value = NumUtil.ParseDecimal(value.ToString()); } } return(AppText(htmlHelper, new RenderTextboxDecimal(), name, value, htmlAttributes)); }
private static MvcHtmlString AppTextboxDecimalFor <TModel, TProperty>(HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, int colspan, object htmlAttributes) { ModelMetadata metadata = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData); if (metadata.Model != null) { if (NumUtil.IsNumeric(metadata.Model)) { metadata.Model = NumUtil.FormatCurrency(NumUtil.ParseDecimal(metadata.Model.ToString()), false); } } return(AppTextFor(htmlHelper, expression, new RenderTextboxDecimal(), colspan, htmlAttributes)); }