I want to know that if I am using a currency converter web service and showing the result using javascript, then how will I be able to trim the result upto 2 decimal places.? I have tried the below mentioned code and I am trying to show the result within a div tag.
When I am trying to convert one currency to another i am getting the result as "xx.xxxxxxx ", but I want to trim the result and show as "xx.xx".
I tried doing this :

Code:
success: function(data) {
            $('#currency_converter_result').html(data.d.toFixed(2));
}
But it is not showing the result.Please point out where am i going wrong ? Thanks This the javascript i am using:
Code:
<script type="text/javascript">
        $(function()
        {
          $('#btnConvert').click(function()
          {
              var amount = $('#txtAmount').val();
              var from = $('#ddlfrom').val();
              var to = $('#ddlto').val();
              $.ajax(
              {
                type: "POST",
                url: "WebService.asmx/CurrencyConversion",
                data: "{amount:" + amount + ",fromCurrency:'" + from + "',toCurrency:'" + to + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function(data) {
                    $('#currency_converter_result').html(data.d);
                }
              }
          }
        }
</script>
Kindly help me to get through this problem.