Add units to Computed Field

Hello,
I’d like to add simple text like “units” to the right of a computed field. For example:

$objectoffield->duree_validite && ‘days’

But, of course, this does not work.

Can anyone help?
I think this is probably pretty easy, but I can’t find any documentation to learn.

Thanks

Hello,

You can try with sprintf

sprintf('%s days', $objectoffield->$objectoffield->array_options['duree_validite'])

1 Like