See logic duplicated between wordpress-mobile/WordPress-iOS#20583 and woocommerce/woocommerce-ios#9555.
Despite opening this issue, I'm a bit on the fence on this one. It would be handy to hide the logic away here, but at the same time it's really just a couple of lines and it might be easier to keep duplicating it across apps and let each consumer adapt its own version.