converting variable in string

I have a variable that queue rate

Internet 1 avg 1000.3kbps/64.8Mbps



Internet 2 avg 510.8kbps/182.4kbps

I want to convert the variable above to this for use with dynamic queue script

1M/64M



500k/180k

help me pls

It’s a work, not a favour…

is theres a way or script to do this?