Skip to content
Advertisement

Calculate the percentage of an object property

I have an object, where i want to calculate the percentage and display in the maps, currently the data i am getting is a raw data in an object.

Here is the object that i am receiving from backend

JavaScript

Based on the object i want the percentage to be calculated and replaced in the respective key/value pair. It will take the object value, sum it up and calculate the percentage. This is what i am expecting to return

JavaScript

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement