Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Javascript: dec to hex + slicing
#1
Hi, I have this javascript that should work.

However, the output does not result in HEX numbers.

var inputValue =  1224277079131226000.0 the
var hex = inputValue.toString(16).toUpperCase();
  var hexsliced = hex.slice(0,-4);
result = '{"tag":"outputTag", "value":"'+ hexsliced + '"}';


I expect the output to be "10FD81845845"
Currently it results "1224277079131226"

Can youplease help me out further?


Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
Javascript: dec to hex + slicing - by Dkyndt - 04-19-2023, 09:02 PM
RE: Javascript: dec to hex + slicing - by Dkyndt - 04-20-2023, 06:50 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)