-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type conversion #27
Comments
I cannot reproduce the issue using the table below. I tried "Add Calculated Values..." with 'int(Num)' and 'Num+2'. Both deliver the expected result. Can you provide an example that fails? Type Num |
Apologies for the long silence here, didn't realise there was a reply ;-) I can see your solution working when I split the calculation into two steps:
Where it doesn't work if both actions are wrapped into one statement, i.e. substring(StringColumn,2,4)*2 or int(substring(StringColumn,2,4))*2 both fail. Bit confusing! I have attached an |
int() requires a number as input, while substring yields a string. If you use substring to populate a column, DataWarrior evaluates it and offers it for further calculations as String and(!) as number, provided it can be interpreted as a number. Now I realize that there is no conversion function from string to number, which I will add to the upcoming DataWarrior update... 'num()' |
num(substring(WellID,2,4))*2 will now work |
Is there a way to convert string to to numericals? E.g. having a column of 01, 02, 03, .... as a result of a substring() calculation, DW correctly states perceived data type: numerical when hovering over the column header.
However, any calculation applied to the numbers will fail. There doesn't seem to be a type conversion, int(x) only accepts double, not strings?
The text was updated successfully, but these errors were encountered: