Skip to content

Instantly share code, notes, and snippets.

@tahmid-ul
Last active June 2, 2021 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tahmid-ul/b8f425bbfc5b8193c531988622ba34a2 to your computer and use it in GitHub Desktop.
Save tahmid-ul/b8f425bbfc5b8193c531988622ba34a2 to your computer and use it in GitHub Desktop.
Fix number format (EU, US) for individual shortcode when used in pdf or email.
<?php
add_filter('fluentform_response_render_input_number', function ($response, $field, $form_id, $isHtml = true) {
if (!$response ) {
return $response;
}
$fieldSettings = \FluentForm\Framework\Helpers\ArrayHelper::get($field, 'raw.settings');
$formatter = \FluentForm\Framework\Helpers\ArrayHelper::get($fieldSettings, 'numeric_formatter');
if (!$formatter) {
return $response;
}
return \FluentForm\App\Helpers\Helper::getNumericFormatted($response, $formatter);
}, 10, 4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment