Dear All,
i want to show price like 50 (PKR) but it is showing like 50.00 (PKR) i want to remove decimal points
please guide me if any one knows how to do this
regerds
Javaid
@Html.Raw(Model.Price)
string pricewithnodecimal=String.Format("{0:C0}", Model.Price)
string currentpage=HttpContext.Current.Request.ServerVariables["PATH_INFO"];
if (currentpage == "/") {
@* do your string formatting here *@
string pricewithnodecimal=String.Format("{0:C0}", Model.Price)
@pricewithnodecimal
}
else
{
@Html.Raw(Model.Price)
}
@model Decimal
<input asp-for="@Model" asp-format="{0:F4}" />
@{
var postfix = "";
if (ViewData.ContainsKey("postfix") && ViewData["postfix"] != null)
{
postfix = ViewData["postfix"].ToString();
}
}
<script>
$(document).ready(function () {
$("#@Html.IdForModel()").kendoNumericTextBox({
min: @Html.Raw(decimal.MinValue),
max: @Html.Raw(decimal.MaxValue),
decimals: 4,
restrictDecimals: true,
format: "#.0000 @postfix"
});
});
</script>
@model Decimal
<input asp-for="@Model" asp-format="{0}" />
@{
var postfix = "";
if (ViewData.ContainsKey("postfix") && ViewData["postfix"] != null)
{
postfix = ViewData["postfix"].ToString();
}
}
<script>
$(document).ready(function () {
$("#@Html.IdForModel()").kendoNumericTextBox({
min: @Html.Raw(decimal.MinValue),
max: @Html.Raw(decimal.MaxValue),
decimals: 4,
restrictDecimals: false,
format: "# @postfix"
});
});
</script>