根据本地化显示逗号而不是在MVC中点数



我有一个控制器返回小数值,例如:1.00我需要将其显示为

1,00在培养中

 $.ajax({
        type: 'POST',
        url: '@Url.Action("ValidateCouponCode","MyAccount")',
        dataType: 'json',
        data: '{ "couponCode" :"' + couponCode + '", "lockerCost" : "' + lockerCost + '" }',
        contentType: 'application/json',
        success: function (data) {
            $.unblockUI();
            $("#txtCouponValue").val(data.CouponAmount);
            $("#txtPaymentAmount").val(data.PaymentAmount);
        },
        error: function () {
            alert("Error occurred");
        }
    });
}

您可以在服务器中使用int.toString("#。0",thread.currentthread.currentuiculture),也可以使用number.prototype.tolocalestring()在客户端中一边,如果您使用客户的本地文化。

最新更新