Databasevalue To Number With 2 Decimals
Hello,
I have a databasevalue like 1.024,50764672563287 and I want conversion to 1.024,51
2 decimals after the comma.
How can I achieve this with vb-script?
I have tried several vb-scripts but not the right one. He always uses the first sepertor and set the value to 1,02
Thanks in advance.
Paul
0
-
Shotaro Ito
★ BarTender Hero ★
Is that German number? On the text's Transform > VB Script > OnProcessData, apply below
'Set locale to German-Germany' Call SetLocale(1031) If IsNumeric(Value) Then Value = FormatNumber(Value,2) End If
On BT10.0 or later, there's number format with specific locale to take such format too.
0 -
Thanks, i've got it working with below code:
Call SetLocale(1043)If IsNumeric(Value) ThenValue=Replace(Value,".","")Value = FormatNumber(Value,2)End If0
Please sign in to leave a comment.
Comments
2 comments