Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300767

Empty rounded numeric fields not hidden properly

$
0
0

I have a numeric field that holds pricing data. If the pricing data in the database is 0.00 or NULL and the field is set to round (I'm rounding to 2 decimal places) and the "Count the number 0 as empty" and "Hide if empty" boxes are checked, then the field is output as 0.00 (expected: hidden). The field is successfully hidden if rounding is disabled.

Probably unnecessary info:
- price column in MySQL is of type decimal(6,2)
- Views integration via Entity API (7.x-1.x-dev)

Steps to reproduce:

  • Add a Number (Decimal) field to a content type (leave it at default scale/precision for 2 decimal places)
  • Create a view on this content type and add the Number field.
  • In 'No results behaviour', tick 'Hide if empty' and 'Count the number 0 as empty'
  • Create nodes with differing numeric values: e.g. NULL (unfilled), 0, 0.0, 0.01 (give the node a corresponding title so you can tell which is which)
  • Observe the View preview and which nodes have a visible number field and which don't

Viewing all articles
Browse latest Browse all 300767

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>