Merge pull request #2745 from IAmBigCoat/recordsFix

Fixed num2hex for large numbers.
This commit is contained in:
Fox McCloud
2015-12-06 02:13:52 -05:00
+2 -4
View File
@@ -50,16 +50,14 @@
var/hex = ""
while(num)
var/val = num & 15
num >>= 4
var/val = num % 16
num = round(num / 16)
if(val > 9)
val = ascii2text(55 + val) // 65 - 70 correspond to "A" - "F"
hex = "[val][hex]"
while(length(hex) < placeholder)
hex = "0[hex]"
return hex || "0"
// Concatenates a list of strings into a single string. A seperator may optionally be provided.