Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

How to get convert number to decimal - jquery

// HazaaZOOZ - jquery - How to get convert number to decimal - jquery

$(document).ready(function() {
  $('.add').click(function() {
     var value = parseFloat($('#total').text()) + parseFloat($(this).data('amount'))/100
     $('#total').text( value.toFixed(2) );
  });
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: Generate random whole numbers javascript 
Javascript :: how to sum array elements in javascript 
Javascript :: Use Recursion to Create a Countdown 
Javascript :: PayloadTooLargeError: request entity too large 
Javascript :: js reverse array loop 
Javascript :: converting bytes into kb js 
Javascript :: npm run test:coverage command in jest 
Javascript :: how to append only once in jquery 
Javascript :: detect keypress 
Javascript :: prime factorization javascript 
Javascript :: js number validation 
Javascript :: Check if a JavaScript string is a URL 
Javascript :: react font awesome npm 
Javascript :: addeventlistener keydown 
Javascript :: hide status bar react native 
Javascript :: html tag run only after whole page is loaded 
Javascript :: how to click button programmatically in jquery 
Javascript :: delay js function 
Javascript :: js canvas line end 
Javascript :: exceljs read file from input 
Javascript :: javascript trim each element in array 
Javascript :: firebase authentication logout 
Javascript :: random color in javascript 
Javascript :: $ is not defined 
Javascript :: javascript prepend element to array 
Javascript :: javascript timestamp in seconds 
Javascript :: javascript init an array to 0 
Javascript :: js mouse enter 
Javascript :: remove time from date in node js 
Javascript :: kill all node process 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =