Decimal Point in Calculations

Parkes Design - September 8, 2009 - 08:32
Project:Views Calc
Version:6.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi, is there a specific way to insert a number value with decimal places in an calculation?

Eg

12.6 + %node_data_field_mmheight.field_mmheight_value (I get an error message The values . in Height Calculation are not allowed.)

but if I put

12 + %node_data_field_mmheight.field_mmheight_value

It works fine. This is a bug right?

I've tested this is both 6.x 1.3 and dev versions.

#1

repolainen - October 28, 2009 - 08:30

Not sure if it is a bug, but my solution for it is to add the decimal marker (dot or comma, depending where you're from) to the allowed functions and operators in settings.

I don't think it should be like this. The problem lies in views_calc_fields_form_validate -function where no decimals are checked on default. Should be rather easy to fix, but the pattern-arrays look rather complicated, that I'm not sure if the maintainer has a specific reason for doing it like this. But for now I'll just use the allowed operators -field.

 
 

Drupal is a registered trademark of Dries Buytaert.