New Python script to add up huge numbers
-
I created a Python script for adding up very large numbers in a selection:
https://github.com/AlloyCoder/AddUpSelected
It properly handles a ton of edge cases - dollar signs, commas as thousands-separators, and lots of neutral characters are stripped away. Anything that makes a number ambiguous will cause it to be ignored.
It currently defaults to a maximum of 60 decimal digits, this is arbitrary and can be changed in the code with a single constant.
The code is certainly not pretty; but just for fun I optimized the heck out of its performance, it even has some optional performance timers.
I hope it might be useful to some as an example for performant Notepad++ Python code. I welcome any comments and suggestions. -
Seemed to work for me (though I didn’t try with enough numbers to notice performance).
Intentionally ignoring scientific notation is a bummer.
-
@PeterJones OK, I’ve added the ability to digest scientific notation, and increased the default accuracy to 200 digits.
Version 1.08 is up on github: https://github.com/AlloyCoder/AddUpSelected