Skip to content

Commit

Permalink
Handle when rating is null for tofixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ddxv committed Nov 6, 2023
1 parent 5e25092 commit d96c959
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion frontend/src/routes/apps/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@
{values.installs}
</td>
<td>
{values.rating.toFixed(2)}
{#if values.rating}
{values.rating.toFixed(2)}
{:else}
null
{/if}
</td>
<td>
{values.rating_count}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface AppFullDetail {
store_developer_link?: string;
developer_url?: string;
updated_at: string;
rating: number;
rating?: number;
rating_count: string;
review_count: string;
histogram: number[];
Expand Down

0 comments on commit d96c959

Please sign in to comment.