[MOD 0.12.x] Nixie Tubes - numeric display elements
- impetus maximus
- Smart Inserter
- Posts: 1299
- Joined: Sat Aug 20, 2016 10:07 pm
- Contact:
Re: [MOD 0.12.x] Nixie Tubes - numeric display elements
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
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"
-
- Filter Inserter
- Posts: 302
- Joined: Fri Mar 18, 2016 4:34 pm
- Contact:
Re: [MOD 0.12.x] Nixie Tubes - numeric display elements
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