Thank you very much, Mr. @ejaaz, for the prompt response. From your reply, I got the message that I have to write code to get/set absolute count as this feature is not available as a property in Rating data type.
however, the suggested formula (((self.rating * 10) % 2) ) to check Modulus value didn’t work for me instead I achieved it from the below server script and the same formula is applicable for the client script as well. Once again thank you for your guidance.
Python code considering rating field set to three star:
UPDATED: JS code considering rating field set to three star:
frappe.ui.form.on("Doctype", {
validate:function(frm){
const targets = [0.333, 0.666, 0.999];
let ratingValue = frm.rating;
let gotAbsCount = targets.reduce((a, b) =>
Math.abs(ratingValue - a) < Math.abs(ratingValue - b) ? a : b
);
alert(gotAbsCount);
}
})