You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before save the value on DB the code replace the current decimal separator with dot (and also remove the thousand separator). On render the value on backed you must replace the dot separator decimals with the selected separator:
For V5 public function render_field( $field ) { $format = $this->parse_format( $field['format'] ); $field['value'] = str_replace( '.', $format['decimal_point'], $field['value'] ); ?> <input type="text" id="<?php echo $field['id'] ?>" class="acf_price" name="<?php echo esc_attr($field['name']) ?>" value="<?php echo esc_attr($field['value']) ?>" data-format-decimals="<?php echo $format['decimals'] ?>" data-format-decimal_point="<?php echo $format['decimal_point'] ?>" data-format-thousands_separator="<?php echo $format['thousands_separator'] ?>" /> <?php }
For V4
Before save the value on DB the code replace the current decimal separator with dot (and also remove the thousand separator). On render the value on backed you must replace the dot separator decimals with the selected separator:
For V5
public function render_field( $field ) { $format = $this->parse_format( $field['format'] ); $field['value'] = str_replace( '.', $format['decimal_point'], $field['value'] ); ?> <input type="text" id="<?php echo $field['id'] ?>" class="acf_price" name="<?php echo esc_attr($field['name']) ?>" value="<?php echo esc_attr($field['value']) ?>" data-format-decimals="<?php echo $format['decimals'] ?>" data-format-decimal_point="<?php echo $format['decimal_point'] ?>" data-format-thousands_separator="<?php echo $format['thousands_separator'] ?>" /> <?php }
For V4
function create_field( $field ) { $format = $this->parse_format( $field['format'] ); $field['value'] = str_replace( '.', $format['decimal_point'], $field['value'] ); ?> <input type="text" id="<?php echo $field['id'] ?>" class="acf_price" name="<?php echo esc_attr($field['name']) ?>" value="<?php echo esc_attr($field['value']) ?>" data-format-decimals="<?php echo $format['decimals'] ?>" data-format-decimal_point="<?php echo $format['decimal_point'] ?>" data-format-thousands_separator="<?php echo $format['thousands_separator'] ?>" /> <?php }
The text was updated successfully, but these errors were encountered: