0.3.0 • Published 1 year ago

fifa-ranking-formula v0.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

FIFA Ranking Formula

npm version

Utility function to calculate the points of a national team based on the result.

The formula implemented is based on the documentation provided by FIFA: Documentation

Example usage

import calculatePoints, { IMPORTANCE, RESULT_SCORE } from 'fifa-ranking-formula';

calculatePoints({ 
  PBefore: 1300, 
  I: IMPORTANCE.PLAY_OFF_AND_FINAL_NATIONS_LEAGUE, 
  W: RESULT_SCORE.WIN, 
  PBeforeTeamB: 1500 
});

Options

const options = {
  PBefore: 1300 // Points of the team before at the start of the game
  I: IMPORTANCE; // Importance score of the game 
  W: RESULT_SCORE; // Result for PBefore team (1 for win, 0.75 for draw, 0.5 for loss)
  PBeforeTeamB: number; // Points of the team played against at the start of the game
  PSO?: boolean; // Did the game finish with a penalty shootout?
  KnockoutRound?: boolean; // Was it a knockout round game?
}
0.3.0

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago