Skip to content

Feature suggestion: truncate floats to specific number of decimal when setting colors #46

@mcintyre321

Description

@mcintyre321

I noticed that setting a cell value (or background colour, or note, etc.) always results in an entry in table.batches, even if you are setting the value to the initial value. This then results in the sheet changing

I can check it manually of course

   if item.get_field_value(score_name) != score_entry['value']:
                item.set_field_value(score_name, score_entry['value'])
    
    table.commit()

but it could be built into the library by caching the initial value, and checking it. You might want this as opt-in option on Table though.

Also it might not be easy to do for background colour. Setting a color like #80FF80 in sheetfu gets stored by sheets as backgroundColor": {"red": 0.5019607843137255, "green": 1.0, "blue": 0.5019607843137255}, so the setting #80FF80 will always look like a change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions