pmbarrett314 / curses-menu

A simple console menu system in python using the curses library
MIT License
471 stars 55 forks source link

Zero-pad numbers in Selection menu for indentation purposes #31

Closed stdedos closed 2 years ago

stdedos commented 6 years ago

I believe feature is self-explainatory. If you have 10 items, then numbering would go 01 etc

I could also attempt to provide a PR, but I haven't been in that culture, so, I am not outright attempting it.

I believe that this is the point of change: https://github.com/pmbarrett314/curses-menu/blob/c76fc00ab9d518eab275e55434fc2941f49c6b30/cursesmenu/selection_menu.py#L15

with some notepad (like pad_no = log10(len(strings)) / index.zfill(pad_no))

stdedos commented 1 year ago

Completed in https://github.com/pmbarrett314/curses-menu/commit/dfcc1602d3a0900cd0eb8051ad8e828022dcee1e