freddyaboulton / gradio-leaderboard

Super fast , batteries included Leaderboard component ⚡️
1 stars 2 forks source link

Format numbers #16

Open RicardoDominguez opened 2 months ago

RicardoDominguez commented 2 months ago

Hi,

Is number formatting supported? e.g., f"{num:.2f}"

If not, what is the relevant part of code that I should look into?

Thank you for the great work!

erumoico commented 2 months ago

Hi @RicardoDominguez! The value attribute is the pd.DataFrame type. So if I'm not mistaken, you can use the .round() or .style() method.

The Open LLM Leaderboard code uses the .round() method.

Is that what you asked? Or did I misunderstand your question?