mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Fixes Casting Error in Export-Excel #108
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user