简体   繁体   中英

DataTable WriteXml Float separator

quick question regarding a DataTable Function which I'm using.

I have a DataTables returned by a SQL stored procedure.

The StoredProcedure returns all fields as individual fieldtypes (string, int, float, datetimes)

quantity (float) 

STORED PROCEDURE:

BEGIN
    SELECT * FROM V_EXPORT_RAPPORTPOSITIONEN_MIT_ITEMID WHERE ID=@ItemID
END

Now I'm using this function in PowerShell

isesp_DataTableToXmlFile $exportFile $EntityName

Which is acutually just:

$global:DetailPosTable.TableName=[string]::Format("{0}detail",$EntityName);
$global:DetailPosTable.WriteXml($exportFileDetails);

Now the problem is that in my Table the float looks like: 3.5

And in my XML-File: 3,5

Even though I changed my region and language to Swiss-German an in the extended properties I set the decimal separator to "." it wont change it.

My question is if I can still try to use the WriteXml Method and check that it's exporting the decimal / float with a "." or if I have to loop through every row while adding it to the DataTable and change it's quantity ?

I just found out that the issue was actually turning on the setting:

在此处输入图片说明

But I also had to restart and reopen my script that it works with these changes...(which I honestly forgot to do).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM