View Single Post
Old 09-06-2014, 06:10 AM   #550
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,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by eschwartz View Post
If the custom column "#complex_series" is set to true -- I'll just test if it has any value -- it will add two decimal places. Mark each awkward series with this.
(This would be easier if I could figure out how to test within a template for a numer with decimals.)
The following tests whether a number is an integer by comparing the integer formatted value against the floating point formatted value.
Code:
program: 
	sindex = raw_field("series_index");
	cmp(format_number(sindex, '{0:d}'), format_number(sindex, '{0:f}'), 'not int', 'int', 'not int')
chaley is offline   Reply With Quote