Skip to content
Permalink
Browse files

Empty float fields should be display as empty

Display empty float fields as empty rather than 0.

Fixes #23475
  • Loading branch information...
Betsy Gamrat authored and vboctor committed Oct 14, 2017
1 parent d24fa5e commit 84c9dc08ec43ebde3bbcd63528a5bcc32548e780
Showing with 1 addition and 1 deletion.
  1. +1 −1 core/cfdefs/cfdef_standard.php
@@ -218,7 +218,7 @@ function cfdef_print_numeric( $p_value ) {
* @param string $p_value The custom field value.
*/
function cfdef_print_float( $p_value ) {
echo (float)$p_value;
echo is_numeric( $p_value ) ? (float)$p_value : '';
}
/**

2 comments on commit 84c9dc0

@atrol

This comment has been minimized.

Copy link
Member

replied Oct 16, 2017

Is this the right place to change data (string to float conversion)?
Maybe it's better to do just what's needed to fix the issue: Don't echo anything if string is empty.

See also my comment to d24fa5e where the string to int conversion even introduces side effects.

@vboctor

This comment has been minimized.

Copy link
Member

replied Oct 17, 2017

@atrol see my comment to the numeric one, which applies here as well.

Please sign in to comment.
You can’t perform that action at this time.