I am trying to convert a string into a double or a float in KDB - the string contains a number with "accounting" format of the like of 2,228,25
(amount) - is I use something like "j"$amount
I get 50 44 50 50 56 46 50 53
as a return value. How do I convert that string into a proper number? Thanks
When casting strings to atoms of other types in kdb+, you must use capital letters to cast. Casting a string with commas to a number will return null values, so try removing them using either except or ssr.
"J"$"2,228,25" except ","
or
"J"$ssr["2,228,25";",";""]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With