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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login