From 06c1f2a560f642ff6680a823f5ea4ac4c7199a8f Mon Sep 17 00:00:00 2001 From: dfinke Date: Mon, 25 Jan 2016 14:19:52 -0500 Subject: [PATCH] Added InvariantInfo to the TryParse call --- Export-Excel.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Export-Excel.ps1 b/Export-Excel.ps1 index 06992a8..d9ffc98 100644 --- a/Export-Excel.ps1 +++ b/Export-Excel.ps1 @@ -119,7 +119,7 @@ function Export-Excel { $r=$null $cellValue=$TargetData - if([double]::tryparse($cellValue, [ref]$r)) { + if([Double]::TryParse($cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) { $targetCell.Value = $r } else { $targetCell.Value = $cellValue @@ -164,7 +164,7 @@ function Export-Excel { } else { $r=$null - if([double]::tryparse($cellValue, [ref]$r)) { + if([Double]::TryParse($cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) { $targetCell.Value = $r } else { $targetCell.Value = $cellValue