There are several ways to deal with conversions/units, depending on use cases and what/how your app works etc…
One option is to store the data in only 1 base unit in the database (e.g. Kg), and then convert it on the page.
Another option is to store all the different unit values as separate fields on the datatype in the database (ok if there’re just a few options e.g. kg or lbs) and then use conditionals on the page to decide which to display depending on what unit is chosen.
If there are a larger number of possible units (such as currencies) then it’s usually simpler to create a separate datatype, and store those separately, and just access the one you need based on the selected unit.
But if you’re just talking about metric or imperial units then either of the first 2 options will be fine.
The first option, storing in just one unit, is probably the simplest, as you won’t need to use lots of conditionals on the page.
It’s probably simplest to do the conversion only once on the page, and then display the converted value anywhere you need it, rather than convert it every time you want to display it. So you can use a custom state that can be set on pageload to store the converted value in whatever unit is selected (and change it whenever the unit is changed), then access that custom state’s value wherever you need to on the page.