private static string TableCellRight(string text, int cellLength)
if(string.IsNullOrEmpty(text))
return "".PadRight(cellLength,' ');
var rest = cellLength - text.Length - 1;
var formattedString = $"{text}"
.PadRight(text.Length + 1)
private static string TableCellLeft(string text, int cellLength)
if(string.IsNullOrEmpty(text))
return "".PadRight(cellLength,' ');
var rest = cellLength - text.Length - 1;
var formattedString = $"{text}"
.PadLeft(text.Length + 1)
public static void Main()
var limitInFahrenheit=600f;
var log = TableCellRight($"{celsius:0.00}°C", cellWidth);
if(f <= limitInFahrenheit)
log += TableCellRight($"{f:0.00}°F", cellWidth);
log += TableCellRight($"", cellWidth);
log +=TableCellLeft($"{k:0.00}K", cellWidth);
log += TableCellLeft($"", cellWidth);
} while (f <= limitInFahrenheit || k <= limitInKelvin);