I've got a shop with an attribute "capacity" created via Magento Backend: Shops -> Attribute -> Product
It has "Text Field" as input type and "Decimal" as validation. So for new products therefore only numerical values can be added.
Now if it comes to sorting in the store front or product list in the backend the sorting for "capacity" is incorrect because Magento handles the values as string.
Correct order should be:
What is the best practice to fix this? Changing the type to price doesn't seem legit to me and can lead to confusion in the future? Should i change the type directly in mysql, remove the current attribute and recreate it programmatically or should i add an plugin that adds some casting to the order function in the product collection?
Any kind of help is appreciated.