Skip to content

encodeRatingValue

encodeRatingValue(totalRating, modulus?): number

Encodes a total rating value by multiplying it with a specified modulus.

This function is used to encode a rating value, typically by scaling it up. For example, if the rating system allows for decimal values, the function can be used to convert these to an integer format by multiplying with 10 (or any other modulus).

Parameters

totalRating: number

The total rating value to encode.

modulus?: number= 10

The modulus to multiply the total rating by (defaults to 10).

Returns

number

The encoded rating value.

Source

network-score/src/Scoring.ts:84