Click here to Skip to main content
15,895,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi..

how to get two digit after decimal in jquery using c#??
but i take my column as string & i cant change it...so please tell me hoe to do this now??
Posted
Comments
Ankur\m/ 16-Dec-13 4:55am    
jQuery is client side technology whereas C# is server side. What do you exactly want. Please remember we cannot see your code. Improve your question using 'Improve Question' widget below your question. You may also add some sample code to explain it better.
Member 10276220 16-Dec-13 5:00am    
function Sum(eval) {
debugger;
var text1 = document.getElementById('BodyContentPlaceHolder_BodyContentPlaceHolder_txtRebate');
var text2 = eval.id;
var text3 = text2.split("_");
var x = parseFloat(text1.value);
var y = parseFloat(document.getElementById(eval.id).value);
var value = parseFloat((x * y) / 100);
var val1 = Math.round(value,2).toString();
document.getElementById('BodyContentPlaceHolder_BodyContentPlaceHolder_grdMember_lblRebate_' + text3[4]).innerHTML = val1.toString();
Member 10276220 16-Dec-13 5:04am    
this is my code:

function Sum(eval) {
debugger;
var text1 = document.getElementById('BodyContentPlaceHolder_BodyContentPlaceHolder_txtRebate');
var text2 = eval.id;
var text3 = text2.split("_");
var x = parseFloat(text1.value);
var y = parseFloat(document.getElementById(eval.id).value);
var value = parseFloat((x * y) / 100);
var val1 = Math.round(value,2).toString();
document.getElementById('BodyContentPlaceHolder_BodyContentPlaceHolder_grdMember_lblRebate_' + text3[4]).innerHTML = val1.toString();

1 solution

Hi You can use simple Javascript to work your task

JavaScript
var input = 45454.3534353; // input: 45454.3534353
          var value = input.toFixed(2);  //value: 45454.35
          var output = value.split('.')[1]; // output:  35
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900