Questions tagged [percentage]

Percentage is a ratio or fraction of a quantity that shows the ratio from whole part of quantity. Percentage demonstrates how much is there out of 100.

The ratio or fraction from a quantity that consider out of 100 is called Percentage.

The Percentage is calculate by following formula:

percentage = (part of quantity * 100)/total quantity
2714 questions
8
votes
2 answers

how to get percentage of two numbers and calculate from a percentage

I am developing a application that need to calculate percentage from two numbers. dotnet have some method for do this? i like to write this calculate by myself. but i don't good in mathematics unfortunately. really, how to get percentage in…
user5752590
8
votes
1 answer

Lodash rounding precision

I'm trying to display a number as a percent by using _.round and then by multiplying the number by 100. For some reason, when I multiply the rounded number, the precision gets messed up. Here's what it looks like: var num = 0.056789, …
8
votes
3 answers

Relative css size to parent of parent

I am asking this because I saw very similar question to mine here. having
8
votes
2 answers

How to have a percentage chance of a command to run

I have 10 things that I want to be printed if they are picked. However each should have a different percentage chance of happening though. I tried doing the following: chance = (random.randint(1,100)) if chance < 20: print ("20%…
Yami
  • 117
  • 1
  • 2
  • 7
8
votes
5 answers

Set Column Width of JTable by Percentage

I need to assign a fixed width to a few columns of a JTable and then an equal width to all the other columns. Suppose a JTable has 5 columns. The first column should have a width of 100 and the second one a width of 150. If the remaining width of…
Tom Tucker
  • 11,676
  • 22
  • 89
  • 130
8
votes
3 answers

how to calculate percentage from a vector of counts

I have a data.frame that looks like this: > dat <- data.frame(Operation = c("Login", "Posted", "Deleted"), `Total Count` = c(5, 25, 40), check.names = FALSE) > dat Operation Total Count 1 Login 5 2 Posted 25 3 Deleted …
jaytika saharan
  • 151
  • 1
  • 1
  • 4
8
votes
4 answers

Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue

Highcharts 3.0 seems to have floating point number accuracy issue when displaying tooltips on a pie chart. I was able to recreate the exact error by using one of the highcharts demo pie chart - Pie with Legend. Click on "Edit in JsFiddle" to edit…
8
votes
2 answers

PHP MySql percentage

My question is about percentages, I'm not an expert so I will try to explain in the better possible way. I have a table with, let say 700 records, in my mysql server, something like this +-------+---------+----------+-------+ | Name | country |…
Andrés Chandía
  • 999
  • 1
  • 16
  • 32
7
votes
3 answers

How to format a number as percentage with 2 decimal places in Presto?

I have a number want to format it as percentage in Presto. I want to format 0.18932 as 18.93%. I tried: format('%s%%', decimal_number*100) format('%s%%', round((a.decimal_number*100), 2)) Here is the result: none formatted: 0.019435618 first…
Jason LiLy
  • 634
  • 2
  • 9
  • 19
7
votes
3 answers

calculate indices with base year and relative percentage change

I am looking for a way to, within id and groups, create an index on 100 using the lag (or is it lead) of value and the new index number idx_value to calculate the next index number. # install.packages(c("tidyverse"), dependencies =…
Eric Fail
  • 8,191
  • 8
  • 72
  • 128
7
votes
0 answers

How to get the battery temperature value on ios 10?

I have found this application on App store in which they are showing battery temperature value. Can anyone help me to know how they are doing it?
manishsharma93
  • 1,039
  • 1
  • 11
  • 26
7
votes
1 answer

ggplot2: How to add percentage labels to a donut chart

I am pretty new to R... so forgive me. I'm trying to make donut plots using ggplot2. I have modified the code of the post ggplot Donut chart but now I'm not able to add the percentage on the chart. This is my attempt: library(ggplot2) blank_theme…
Giorjet
  • 93
  • 2
  • 11
7
votes
1 answer

change value to percentage of row in R

this is my data A B C A 9 1 0 B 2 2 2 C 3 3 3 I want to get percentage of each row my expect data is A B C A 0.9 0.1 0 B 0.33 0.33 0.33 C 0.33 0.33 0.33 I made my data with 'dcast' and there is column name on A,B and C. so…
DK2
  • 651
  • 1
  • 7
  • 34
7
votes
3 answers

PHP calculate percentages

I need some help. It's a simple code, but I don't have idea how to write in down. I have the numbers: $NumberOne = 500; $NumberTwo = 430; $NumberThree = 150; $NumberFour = 30; At all this is: $Everything = 1110; // all added Now I want to show…
Chris
  • 119
  • 1
  • 2
  • 5
7
votes
3 answers

Calculate Percent Increase and Decrease

I'm likely over-thinking this, but I'm looking for something a bit more elegant than what I currently have. I have this method called CalculatePercentageTrend, which takes in a long "previous" value and "current" value. As it currently stands…
X3074861X
  • 3,709
  • 5
  • 32
  • 45