Hi, i need to format numbers to pointed decimal numbers. i want to do it with vb.net. Here is the code in Invoke Code activity;
Dim culINfo As New System.Globalization.CultureInfo(“tr-TR”)
Dim nfi As System.Globalization.NumberFormatInfo
Dim mySizes1 As Integer() = {3}
nfi = culINfo.NumberFormat
nfi.NumberGroupSizes = mySizes1
nfi.NumberDecimalSeparator = “,”
nfi.NumberGroupSeparator = “.”
'N2 means after dot two digits will allow. for example ;
'1234.56 ->“N2” → 1,234.56
'1234.56 ->“N3” → 1,234.560
Dim deger As Int32
Dim doubleDeger As Double
Dim str As String
For Each row As DataRow In io_dt.Rows
If (CDbl(row("Tutar")) - CInt(row("Tutar")) )>0 Then
row("Tutar")=row("Tutar").ToString("N2", nfi)
Else
End If
Next row
it gives me error which i couldn’t solve. my goal is to format from not pointed numbers to pointed numbers in a dataTable
this is a column in my dataTable which i want to format
But keep in mind with a F2 the decimal part will be forced to .XX. Does mean for:
114460000 will be 114,460,000.00 e.g. dblDemoValue.toString(“N2”, nfi)
Kindly note: results from immediate panel (used for quick prototypings) can sometimes differ from watch panel /code /log message and is less meanfully
I gues German / Turkish formats on numbers are same . for Groups , for Decimal seperator
RnD were not done fully and confirmable but i guess a custom nfi leads to wrong formats (missing , on Groups). using nfi from CultureInfo works as we can see in playground xaml