Calculate accuracy

Calculate the accuracy of any game mode based off of a score’s properties with the calcAccuracy constant and its methods. Every method returns a number between 0 and 1 (or at least it should as long as the values are from a real score).

Standard

Calculate accuracy for osu! standard.

Example

import { calcAccuracy } from 'osu-web.js';

const accuracy = calcAccuracy.osu(1756, 26, 0, 0); // Output: 0.9903 (Fixed to 4 decimals)

Parameters

ParameterTypeOptionalDescription
c300numberNumber of 300s
c100numberNumber of 100s
c50numberNumber of 50s
missesnumberNumber of misses

Taiko

Calculate accuracy for osu! taiko.

Example

import { calcAccuracy } from 'osu-web.js';

const accuracy = calcAccuracy.taiko(2896, 55, 0); // Output: 0.9907 (Fixed to 4 decimals)

Parameters

ParameterTypeOptionalDescription
gekinumberNumber of greats
katunumberNumber of goods
missesnumberNumber of misses

Catch

Calculate accuracy for osu! catch.

Example

import { calcAccuracy } from 'osu-web.js';

const accuracy = calcAccuracy.fruits(3277, 75, 557, 5, 0); // Output: 0.9987 (Fixed to 4 decimals)

Parameters

ParameterTypeOptionalDescription
c300numberNumber of caught fruits
c100numberNumber of caught drops
c50numberNumber of caught droplets
katunumberNumber of drops
missesnumberNumber of droplets

Mania

Calculate accuracy for osu! mania (score v1 and v2).

Example

import { calcAccuracy } from 'osu-web.js';

const sv1Accuracy = calcAccuracy.mania(6349, 1940, 126, 15, 5, 24); // Output: 0.9905 (Fixed to 4 decimals)
const sv2Accuracy = calcAccuracy.mania(6349, 1940, 126, 15, 5, 24, true); // Output: 0.9866 (Fixed to 4 decimals)

Parameters

ParameterTypeOptionalDescription
gekinumberNumber of maxes
c300numberNumber of 300s
katunumberNumber of 200s
c100numberNumber of 100s
c50numberNumber of 50s
missesnumberNumber of misses
scoreV2booleanCalculate with score v2 formula? Defaults to false

Notice that something is missing? Found a typo? Think something's incomplete? Or think that something can be explained better? Feel free to open a pull request or submit an issue on the library's Github repository .