Skip to content

calc: improvements/config #2547

Open
Open
@ghost

Description

Preface: this can likely wait for calc to be extracted (sopel-calc or whatever), but there's a couple of things I'd like to see either be changed or made as config options.


First: please, please, for the love of God let me turn off e+# notation. Sometimes it's not even useful and literally takes more characters...

<user> .c 123456*123456
<bot> [calc] 1.524138394e+10

What was saved here? Instead of outputting 15241383936 it rounded up the second-to-last digit and then added 3 extra characters...

Anyway, I understand if configuration would be preferred here. I'm sure some people prefer the e+# stuff. Neither me nor my users do, but I realize we're not the whole world.


Second: I've love to have commas in the output, especially if the above is implemented. e.g.:

<user> .c 123456*123456
<bot> [calc] 15,241,383,936

Can totally understand this being optional. In theory it'd be a simple if/else on the output.

if some_config == add_commas:
    '{:,}'.format(result)
else:
    str(result)

or whatever. :P

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions