See https://docs.pods.io/displaying-pods/magic-tags/display-filters-with-magic-tags/
Define a formatting function using a Code Snippet plugin, plugin added to wp-content/plugins or wp-content/mu-plugins, or theme’s functions.php:
<?php
/**
* Plugin Name: Format Surface Area
*/
function fmt_area( $number ) {
// Second argument is number of significant figures.
$number = number_format( $number, 1 );
// Replace '.0' with nothing.
$number = str_replace( '.0', '', $number );
// Output template, where %s is the variable placeholder.
// @see https://www.php.net/manual/en/function.sprintf.php
return sprintf(
'Surface: %sm²',
$number
);
}
Then, if the function is named fmt_area, add fmt_area to the comma-separated list of allowed display callback functions near the bottom of Pods Admin > Settings, and use the callback function by adding its name after a comma in the magic tag, for example {@surface,fmt_area}
Hi,
thank you, your solution is working!
Regards
Christophe