Precision Modes in ASP.NET MVC Rating Control

23 Jan 20231 minute to read

You can use the Precision property of the ASP.NET MVC Rating control to provide ratings with varying levels of precision.

The precision types of Rating are as follows:

  • Full: The rating is increased in whole number increments. For example, if the current rating is 2, the next possible ratings are 3, 4, and so on.
  • Half: The rating is increased in increments of 0.5 (half). For example, if the current rating is 2.5, the next possible ratings are 3, 3.5, 4, and so on.
  • Quarter: The rating is increased in increments of 0.25 (quarter). For example, if the current rating is 3.75, the next possible ratings are 4, 4.25, 4.5, and so on.
  • Exact: The rating is increased in increments of 0.1. For example, if the current rating is 3.9, the next possible ratings are 4, 4.1, 4.2, and so on.
@using Syncfusion.EJ2.Inputs

<label>Full Precision</label><br />
@Html.EJS().Rating("rating").Value(3).Precision(PrecisionType.Full).Render()<br />

<label>Half Precision</label><br />
@Html.EJS().Rating("rating1").Value(2.5).Precision(PrecisionType.Half).Render()<br />

<label>Quarter Precision</label><br />
@Html.EJS().Rating("rating2").Value(3.75).Precision(PrecisionType.Quarter).Render()<br />

<label>Exact Precision</label><br />
@Html.EJS().Rating("rating3").Value(2.3).Precision(PrecisionType.Exact).Render()
public ActionResult PrecisionModes()
{
    return View();
}

ASP.NET MVC Rating Control with different Precision Types