When in currency formatting settings of Shopify admin is set to {{ amount }} as described in this post how to change money formatting in shopify.
Then we can use these money filters to show the amounts with and without trailing zero. like here
if “HTML with currency” is ${{ amount }} CAD
{{ 14300 | money_without_trailing_zeros }}
the output of this will be $143
{{ 143 | money_without_trailing_zeros }}
the output of this will be $1.43
You can customize this in your theme files.