Page 8 of 8

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Posted: Wed Mar 28, 2018 4:23 pm
by impetus maximus
i've always found github hard to navigate. i just visited the nixie tube's github, and i don't see any discussions.

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Posted: Wed Jul 24, 2019 5:52 am
by DaveMcW
I wanted to build a nixie tube clock, but it does not look so good when leading zeroes are hidden. I wrote this patch to zero pad 2-digit nixie tubes only.

Code: Select all

    local format = "%i"

    -- Zero pad 2-digit nixie tubes
    if global.controllers[entity.unit_number]
    and global.nextdigit[entity.unit_number]
    and global.nextdigit[entity.unit_number].valid
    and not global.nextdigit[global.nextdigit[entity.unit_number].unit_number] then 
      format = "%02i"
    end

    if float and hex then
      format = "%A"

Re: [MOD 0.12.x] Nixie Tubes - numeric display elements

Posted: Wed Jul 24, 2019 6:12 am
by justarandomgeek
Add 100 (or 10000 or whatever) to the signal so it's longer than the display and it will be truncated leaving the leading zeroes