I hope this script helps!

To convert back, just use an [If].