Change hash key based on hash value

hash = {
“price”: “419.5”,
“pricelevelname”: “STOCKING DEALER”
}
Expected Result
{
“price_STOCKING DEALER”: “419.5”,
“pricelevelname”: “STOCKING DEALER”,
}

how to achieve this

Not really sure what you are trying to achieve here.

Could you elaborate on what you are doing in your posted example?

You have to iterate through the pairs, remove the original key/value pair and add the new one.
Or construct a new hash based on your findings and assign it to the old hash-variable.