Skip to content

Allow cells to be formatted as numbers#6

Open
duckbrain wants to merge 2 commits intoivahaev:masterfrom
ec2-software:master
Open

Allow cells to be formatted as numbers#6
duckbrain wants to merge 2 commits intoivahaev:masterfrom
ec2-software:master

Conversation

@duckbrain
Copy link

Allows cells to be number formatted by prefixing the value with a # followed by a valid numeric string. In the template, the number formatting can be applied to an individual cell to have the looped rows each have that formatting when formatted as a number.

This allows users viewing the Excel file to select ranges to see a sum, create formulas that do arithmetic on cells, and much more.

Example

Template
Name Pay
{{range users}}
{{name }} #{{pay}}
{{end}}
Data
[
  {
    "name": "Alice",
    "pay": 27
  },
  {
    "name": "Bob",
    "pay": 31.5
  }
]
Reults
Name Pay
Alice $27.00
Bob $31.50

It's untested if this works with timestamps, but if not. I'd submit @ as a prefix to signify it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant