Last active
June 2, 2021 08:18
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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