View Single Post
Old 12-05-2018, 04:58 AM   #1235
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,489
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
Would it be possible to write a template function (see Preferences->Advanced->Template functions) that formats numbers with commas and a period in the anglo-normal way, and does the regex to change the comma's into space and the period (if any) into a comma.

Then use that template in integer and float column definitions.

BR
Quote:
Originally Posted by davidfor View Post
I don't know. The formatting appears to just be calling a Python format function. I don't know if that can be extended in a way that it can be used here.
Davidfor is correct, the format string isn't a template. It is instead the part of a template that affects how the value is formatted.

That could be changed (process the format as a template). That would require some syntax to tell calibre that the string is a full template instead of a simple format string, perhaps something like a leading colon. It also would be a bit slower, but probably not significantly.

The real question: is the worth doing? Would more than one person use it?
chaley is offline   Reply With Quote