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

SQL - Calculate percentage on count(column)

I have the following piece of code which counts how many times something appears in the event column. SELECT event, count(event) as event_count FROM event_information group by event event event_count a 34 b 256 c 45 d …
Dean Flaherty
  • 351
  • 1
  • 5
  • 15
29
votes
3 answers

Calculate percentage between two columns in SQL Query as another column

I have a table with two columns, number of maximum number of places (capacity) and number of places available (availablePlaces) I want to calculate the availablePlaces as a percentage of the capacity. availablePlaces capacity 1 …
missdevops
  • 329
  • 1
  • 3
  • 7
29
votes
8 answers

Percentage rank of matches using Levenshtein Distance matching

I am trying to match a single search term against a dictionary of possible matches using a Levenshtein distance algorithm. The algorithm returns a distance expressed as number of operations required to convert the search string into the matched…
user1368587
  • 321
  • 1
  • 3
  • 5
25
votes
4 answers

MySQL: How do i update 50% of the rows, randomly selected?

I want to update 50% of the rows in a table, randomly selected. Is there any way to do that? Edit: Just to clarify that it should always update 50% of the records, but of those 50% the rows must be randomly selected (not only the top 50% for…
James
  • 311
  • 1
  • 4
  • 10
23
votes
7 answers

Formatting number as percentage

I don't understand how NSNumberFormatterPercentStyle works! Example: NSNumber *number = [NSNumber numberWithFloat:90.5]; NSNumberFormatter *percentageFormatter = [[[NSNumberFormatter alloc] init] autorelease]; [percentageFormatter…
Mustafa
  • 20,504
  • 42
  • 146
  • 209
23
votes
3 answers

Div Height in Percentage

Possible Duplicate: Percentage Height HTML 5/CSS This needs to be a simple one but I why the height specified in percentage for a div is not apply to it. For example:
adsf
CSS: .container { width:80%; …
ZedBee
  • 2,320
  • 7
  • 39
  • 61
22
votes
7 answers

Is there a way to specify ag-grid column width in percentage?

Right now, the only way I see to specify column grid width is to add a width property to column definition like: columnDefs: any[] = [ { headerName: 'ID', field: 'id', width: 50, type: 'numericColumn' } ]; But as we can see in…
HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
22
votes
4 answers

Formatting a cell to a percentage in PHPExcel

I am automating an excel spreadsheet using PHP. I have been looking for a way to pragmatically format a cell to a percentage in PHPExcel. I want to change a value like 0.077922078 to 8% Is there a solution for this? Thanks in advance.
cwiggo
  • 2,541
  • 9
  • 44
  • 87
21
votes
5 answers

Pandas - get first n-rows based on percentage

I have a dataframe i want to pop certain number of records, instead on number I want to pass as a percentage value. for example, df.head(n=10) Pops out first 10 records from data set. I want a small change instead of 10 records i want to pop first…
Mohamed Thasin ah
  • 10,754
  • 11
  • 52
  • 111
21
votes
2 answers

Rails: How to print a decimal as a percent?

Is there a way to print a decimal as a percentage, so only the two digits after the period? My decimals will always be between 1 and 0, so I suppose it would work to call number.round(2) starting with the third character, but I can't find the…
user4133294
20
votes
4 answers

Variable name percent from 0 to 1

So this seems like I should have been wondering about this when I first started programming, but I suppose back then I wasn't as concerned with 'perfect' variable naming. So I have the variables float lifeTime; float age; Where lifeTime is the full…
user3294236
  • 380
  • 2
  • 7
19
votes
2 answers

Decimal places in CSS percentage

OK, I've searched far and wide and come up with nothing more than anecdotal evidence to suggest that there is no recommended standard behaviour in the CSS specification for the precision of floating point numbers. N.B. I'm not asking about the well…
chrisfrancis27
  • 4,516
  • 1
  • 24
  • 32
19
votes
2 answers

Is it allowed to use any decimal value in CSS keyframe animations?

I'm wondering if it's ok to use percentage values like this: @keyframes myAnimation { 0% { height: 100px; } 33.3% { height: 120px; } 66.6% { height: 140px; } 100% { height: 200px; } } It seems to work, but it I am not sure if…
Seka
  • 1,413
  • 2
  • 12
  • 16
18
votes
4 answers

Android - ConstraintLayout percentage using dimens

There is a question How to make ConstraintLayout work with percentage values? and its answers show how to use the percentages:
18
votes
2 answers

Query giving division by zero error in PostgreSQL

I am trying to run the following query which results me postgres error: division by zero select request_count, response_count, (response_count*100) / (request_count+response_count) AS proportion from total_dummy_table; How can I…
AKIWEB
  • 19,008
  • 67
  • 180
  • 294