Fixes Casting Error in Export-Excel #108

This commit is contained in:
dfinke
2016-06-28 15:01:41 -04:00
parent 1788e6bbe8
commit 3c5020f137
3 changed files with 67 additions and 66 deletions

View File

@@ -135,7 +135,7 @@ function Export-Excel {
$r=$null
$cellValue=$TargetData
if([Double]::TryParse($cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) {
if([Double]::TryParse([string]$cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) {
$targetCell.Value = $r
$targetCell.Style.Numberformat.Format=$Numberformat
} else {
@@ -181,7 +181,7 @@ function Export-Excel {
} else {
$r=$null
if([Double]::TryParse($cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) {
if([Double]::TryParse([string]$cellValue,[System.Globalization.NumberStyles]::Any,[System.Globalization.NumberFormatInfo]::InvariantInfo, [ref]$r)) {
$targetCell.Value = $r
$targetCell.Style.Numberformat.Format=$Numberformat
} else {