It's all there in [strformat](https://nim-lang.org/docs/strformat.html), if you 
can get through the docs.
    
    
    import std/strformat
    let foo = 3735928559
    echo fmt("{foo:X}")
    
    stdout.write('[')
    for i, n in [42,52,91]:
      if i > 0: stdout.write(',')
      stdout.write(fmt("{n:#X}"))
    echo ']'
    
    # DEADBEEF
    # [0x2A,0x34,0x5B]
    
    
    Run

Reply via email to