There is a similar question here: How to display the product weight in kg, if more than 1000 grams
But the code the user provides adds a new paragraph with the weight