lcd screen decimal issues

I want to use an lcd screen on my robot for some debugging, so i wrote some code to display some variables I will be using in my code. Specifically, this is my test code:
float currentRotationL=79.65;
float currentRotationR=80.25;
task main()
{
clearLCDLine(0);
displayLCDNumber(0,0,nAvgBatteryLevel);
displayLCDNumber(1,0,currentRotationL);
displayLCDNumber(1,9,currentRotationR);
wait1Msec(10000);
}
When I ran this code, the two numbers on the second line came up as 79 and 80. Some poking around in the help files showed that the displayLCDNumber function automatically turns the third input into a int for some cockamamie reason. facepalm How can I make this display decimals? My teacher suggested turning the numbers into strings; how can I do that?
tl;dr: Functions to display numbers on the LCD screen turn them into ints. How do I bypass this to display decimals?

Use the sprintf function to format the variables into a string that you then send to the LCD, it’s much more flexible than displayLCDNumber.

float currentRotationL=79.65;
float currentRotationR=80.25;
task main()
{
  string  lcdString;
  clearLCDLine(0);
  
  sprintf(lcdString,"%d", nAvgBatteryLevel );
  displayLCDString(0, 0, lcdString);

  sprintf(lcdString,"%.2f", currentRotationL );
  displayLCDString(1, 0, lcdString);
  sprintf(lcdString,"%.2f", currentRotationR );
  displayLCDString(1, 9, lcdString);
  
  // or an alternative
  sprintf(lcdString,"%5.2f    %5.2f", currentRotationL,currentRotationR );
  displayLCDString(1, 0, lcdString);
  
  wait1Msec(10000);
}

nAvgBatteryLevel is an integer, no need to try and format that as a float.