(Gast)
n/a Beiträge
|
AW: equivalent für wcstof
29. Okt 2017, 12:55
Rating funktioniert wie es soll.
Delphi-Quellcode:
function ComputeStarRate: LongInt;
var
FS: TFormatSettings;
nRate: LongInt;
rating: Single;
average, popularity: single;
begin
FillChar(FS, SizeOf(FS), 0);
FS.DecimalSeparator := '.';
average := StrToFloat(gM.vote_average, FS);
FillChar(FS, SizeOf(FS), 0);
FS.DecimalSeparator := '.';
popularity := StrToFloat(gM.popularity, FS);
rating := average + (popularity / 150.0);
nRate := min(max(round(rating * 15), 0), 150);
result := nRate;
end;
gruss
Geändert von EWeiss (11. Jul 2019 um 16:48 Uhr)
|
|
Zitat
|