// Get the value of the input field named "number" $number = JRequest::getFloat('number'); // Check if the value is a float if (is_float($number)) { // The value is a float, do something with it... } else { // The value is not a float, show an error message... }
// Get the value of the URL parameter named "height" $height = JRequest::getFloat('height', 0.0); // Do something with the height value...In this example, we specify a default value of 0.0, which will be used if the "height" parameter is not present in the URL. The JRequest class is part of the Joomla framework, which is included in the Joomla core package.