diff --git a/docx-core/src/reader/attributes/width.rs b/docx-core/src/reader/attributes/width.rs index f65932a..4ab9c09 100644 --- a/docx-core/src/reader/attributes/width.rs +++ b/docx-core/src/reader/attributes/width.rs @@ -14,7 +14,7 @@ pub fn read_width(attrs: &[OwnedAttribute]) -> Result<(isize, WidthType), Reader if local_name == "type" { width_type = WidthType::from_str(&a.value)?; } else if local_name == "w" { - w = isize::from_str(&a.value)?; + w = f64::from_str(&a.value).expect("should read width.") as isize; } } Ok((w, width_type))