I am currently trying to render the price value of products using a widget in Flutter. To do so, I pass the state and render it in the argument from the corresponding widget. What I need to achieve is to hide the 2 decimals of my Double type priceValue and show them if they are != to 0.
Like so, if state.priceValue = 12.00 $ => should show 12 if state.priceValue = 12.30 $ => should show 12.30