View Single Post
Old 10-08-2013, 04:09 AM   #2
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,452
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
You don't give a context for where you want to use this value. I am assuming you want it in some save- or send- template.

One way using general program mode:
Code:
program: re(format_number(field('series_index'), '{0:05.2f}'), '\.00', '')
You would add any other fields to re's return value as needed, possibly using the template or finish_formatting functions.

Another way using template program mode:
Code:
{:'template("program: re(format_number(field('series_index'), '[[0:05.2f]]'), '\.00', '')")'}
Using "template" is required here because you cannot use { and } in template program mode and these characters are required by format_number. The template function converts the [[ and ]] to { and }.

Yet another way: write your own user defined template function to do what you want.
chaley is offline   Reply With Quote