private static double ConvertToCM(string width) { try { bool isInch = SizeConverter.IsInch(width); NumberFormatInfo numberFormat = CultureInfo.InvariantCulture.NumberFormat; width = width.Replace(",", "."); double w = SizeConverter.GetDoubleFromAnOfficeSizeValue(width); if (isInch) { w = SizeConverter.InchToCm(w); } return(w); } catch (FormatException e) { throw new ContentMockerException(string.Format( "Failed to convert {0} into decimal value", width), e); } }