$name = "John"; $age = 25; $message = JText::printf('Hello %s, you are %d years old', $name, $age); echo $message;
$num = 12345.6789; $message = JText::printf('The number is %.2f', $num); echo $message;This code will output "The number is 12345.68". The "%.2f" placeholder formats the number variable to two decimal places. JText printf is a method in the Joomla Framework.