Round the value of numbers in a DataGrid Component to quarters

Hello, I want to round the value of the data in the grid column "dauer" to quarters (.25, .5, .75, .00).

This is the custom method I wrote:
public IActionResult Round(double x)
var round = Math.Round(x/0.25)*0.25;

        return Json(new { round });

I don´t know how to display the result of the calculation in the datagrid column only for sight purpose, it shouldnt change the data itself.

You can try using the number Angular pipe. Or try using the Math object in a similar way (although it is a bit complicated in Angular).

  1. Create a property with Name math and Value Math in your Radzen page.

  2. Set the Template of your DataGrid column to ${math.round(data.PropertyName / 0.25) * 0.25}

1 Like

Thank you so much, it works now!