Skip to content

Commit

Permalink
fix author rating num
Browse files Browse the repository at this point in the history
  • Loading branch information
Qaleka committed Dec 16, 2024
1 parent faaec5b commit b923f52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/service/utils/convert_ads.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"log"
"math"
"time"
)

Expand Down Expand Up @@ -95,7 +96,7 @@ func ConvertAdProtoToGo(ad *gen.GetAllAdsResponse) (domain.GetAllAdsResponse, er
AdDateTo: parsedDateTo,
IsFavorite: ad.IsFavorite,
AdAuthor: domain.UserResponce{
Rating: float64(ad.AdAuthor.Rating),
Rating: math.Round(float64(ad.AdAuthor.Rating)*10) / 10,
Avatar: ad.AdAuthor.Avatar,
Name: ad.AdAuthor.Name,
Sex: ad.AdAuthor.Sex,
Expand Down

0 comments on commit b923f52

Please sign in to comment.