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
7
votes
7 answers

C How to calculate a percentage(perthousands) without floating point precision

How do you calculate a percentage from 2 int values into a int value that represents a percentage(perthousands for more accuracy)? Background/purpose: using a processor that doesn't have a FPU, floating point computations take 100's of times…
Ashitakalax
  • 1,437
  • 1
  • 18
  • 26
7
votes
2 answers

Row Percentages in crosstable generated from summary() from the Hmisc package

I have been trying to learn to use the summary()-function from the Hmisc-package to generate crosstables that include chisquared tests. With help from this board I'm almost there. I just can't figure out how to obtain row-percentages instead of…
Rene Bern
  • 545
  • 3
  • 10
  • 18
7
votes
3 answers

How to calculate the original value given a percentage inclusive value?

We have a shopping cart that is used in different places, therefore the tax is stored in a config file, presently in New Zealand it is 15%, so in the config file we are storing .15 but this number can be changed, so I need to formulas to not rely on…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
7
votes
4 answers

Convert percentage to nearest fraction

We have a very data intensive system. It stores raw data, then computes percentages based on the number of correct responses / total trials. Recently we have had customers who want to import old data into our system. I need a way to covert a…
Chris Kooken
  • 32,730
  • 15
  • 85
  • 123
7
votes
1 answer

Limit Child DIV Height to Parent DIV Height With Variable Sibling

I have a container
with a specified height, and contained within are two more DIVs, on for introductory copy that will vary (entered by the client), and another to list out various features. I want the features
to automatically fill the…
Ty Morton
  • 733
  • 2
  • 8
  • 29
6
votes
1 answer

How do I create a percentage counter in jQuery?

I tried to create a percentage counter but it doesn't do something that I need. It just shows 100%. However I need to show all 0 to 100% step by step! How should I change it? setInterval(function per(p = 0) { for (p = 1; p <= 100; p++) { …
6
votes
3 answers

Override background-color by a certain percentage

I'm adding row throught a with a foreach. At some point I want a cell to have a grey background based on the percentage calcultated in PHP. Ex: 50% means half the background of the cell with be grey the rest will stay blank | 33,33% = 1/3 of…
Nirnae
  • 1,315
  • 11
  • 23
6
votes
1 answer

ggplot donut chart percentage labels

I'm trying to add percentage labels to a donut chart but have been unsuccessful in plotting a clear representation of percentage values (rounded and not overlapping) ## my data library(ggplot2) col <- c("white", "black", "transparent", "grey",…
Beaver
  • 95
  • 2
  • 8
6
votes
3 answers

Using percentage function with accumarray

I have two arrays: OTPCORorder = [61,62,62,62,62,62,62,62,62,62,62,62,65,65,...] AprefCOR = [1,3,1,1,1,1,1,1,1,1,2,3,3,2,...] for each element in OTPCORorder there is a corresponding element in AprefCOR. I want to know the percent of the number 1…
chinkare_16
  • 135
  • 7
6
votes
1 answer

How to draw a ggplot2 with facet_wrap, showing percentages from each group, not overall percentages?

I'd like to draw a ggplot with facet_wrap, which doesn't show the actual table percent, but the percent of the given answer in each group. I have to do this, because I want to show, which answer is most selected and most important for each group.…
Martin
  • 307
  • 3
  • 10
6
votes
2 answers

How to print the percentage of zipping a file python

I would like to get the percentage a file is at while zipping it. For instance it will print 1%, 2%, 3%, etc. I have no idea on where to start. How would I go about doing this right now I just have the code to zip the file. Code: zipPath =…
user4429937
6
votes
5 answers

Calculating percentages in js

I'm trying to create a simple percentage calculator using javascript. I try a simple calculation in the console (try it): 106 / 100 * 10 And it returns me: 10.600000000000001 What is going on here? Brackets makes no difference and this doesn't…
James
  • 969
  • 1
  • 8
  • 13
6
votes
4 answers

Cumulative histogram with percentage on the Y axis

I wish to plot in R project a cumulative histogram where on the Y axes is reported the percentage instead of the frequency x <- c(rnorm(100), rnorm(50, mean=2,sd=.5)) h <- hist(x, plot=FALSE, breaks=20) h$counts <- cumsum(h$counts) h$density …
Gianni Spear
  • 7,033
  • 22
  • 82
  • 131
5
votes
0 answers

How can I format a label created using Matplotlib's bar_label as a rounded percent?

Matplotlib 3.4.2 has a function called bar_label that makes it easier to add data labels to bar charts. I have data in decimal form (e.g. 0.9783), and I want to use bar_label to create data labels in percentage form and rounded to the nearest unit…
KBurchfiel
  • 635
  • 6
  • 15
5
votes
2 answers

R kable/kableExtra, conditional formatting by percentage (with missing values)

I am using kable and kableExtra and want to display a table with columns of percentages (in format "95%"). I would also like to do conditional formatting of the cell backgrounds based on the percent value (with multiple colors and cut points). In…
Megan C
  • 53
  • 1
  • 3