#str

4 posts· Last used 19h

Replying to @gim@queer.group
Example: #let padInt(number, targetLen) = { if number >= calc.pow(10, targetLen) [ #str(number) ] else { let n = targetLen let r = number while n > 0 { n = n - 1 let p = calc.pow(10, n) let c = calc.floor(r / p) r = r - (c * p) str(c) } } } There's no function to left pad zeros to an int (or other number types). There isn't a function to cut off decimals either...
0
0
0
0
You've seen all posts