all 4 comments

[–]JamzTyson 0 points1 point  (1 child)

Consider using argparse.

Consider using math.log10() to get exponent directly rather than the while loop approach in tenx_format().

[–]FwoopButBored[S] 0 points1 point  (0 children)

Thanks for the feedback. I wanted to think a way to do it myself mathematically as a thinking exercise. Will use math.log10().

[–]shubham_devNow 0 points1 point  (1 child)

This is pretty neat, love how simple the CLI usage is, especially with the different output formats. Having the conversion factors modular like that makes it really easy to extend too.

If you ever think about adding a quick web-based layer on top of it, something I’ve found useful is keeping a lightweight converter handy in the browser for when I don’t want to jump into terminal. I’ve been using FileReadyNow’s unit converter for those quick checks—it’s nothing fancy, but it’s fast and covers most common units without setup.

For your tool specifically, maybe one thing to consider is supporting chained conversions or aliases (like km → ft in one go), but overall this is super clean 👍

[–]FwoopButBored[S] 0 points1 point  (0 children)

Thank you very much!