Converting Text number with prefix into numbers

I import in a filemaker DB a huge list as text files from FileBuddy which gives file names, file location and file size
SIze are described as follows:
EXMSPLEs
666,73 MB
1,36 GB
432 KB
After Importing the text list in the Filemaker database I have the “SIZE” field polupated with text so I am unable to sort the sizes as numbers.
How can I write a script to place within Filemaker so the “SIZE” field can be converted in an integer to sort the SIZE field as numbers?
Filemaker allows me to import an applescript where I only need to specify the field I want the script to operate.
Example of possible results:
if the text field is 921,5 MB the resulting number should be 921500000
or
if the text field is 2,16 GB the resulting number should be 2160000000 from
or
if the text field is 89 KB the resulting number should be 89000

The syntax in the fields is always the same
digits followed with a space then KB or MB or GB. Some include a “,”

Any help highly appreciated

Dan

I guess that Shane STANLEY will post a more efficient code but here is my proposal which, in this shape, requires Yosemite

use AppleScript version "2.4"
use framework "Foundation"
use scripting additions

set source to {"921,5 MB", "2,16 GB", "89 KB"}

set convertedValues to {}
repeat with aString in source
	set origVal to (text 1 thru -4 of aString) as number
	set theUnit to text -2 thru -1 of aString
	if theUnit is "KB" then
		set theVal to origVal * 1000
	else if theUnit is "MB" then
		set theVal to origVal * (1000^2)
	else if theUnit is "GB" then
		set theVal to origVal * (1000^3)
	else if theUnit is "TB" then
		set theVal to origVal * (1000^4) # ADDED
	end if
	set theVal to (its formatnumber:theVal)
	set end of convertedValues to theVal
end repeat
convertedValues

#=====

on formatnumber:theNumber
	set theResult to current application's NSNumberFormatter's localizedStringFromNumber:theNumber numberStyle:(current application's NSNumberFormatterNoStyle)
	return theResult as text
end formatnumber:

#=====

Yvan KOENIG running Yosemite 10.10.5 in French (VALLAURIS, France) lundi 21 septembre 2015 19:05:53