- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
21-03-22 02:24 PM
Hi community,
I'm from Denmark, I have English language set on and using danish comma for seperating numbers. This means function seperators and number commas will be mixed up.
Take this expression as an example:
Mid([Item Data.CPR], 3, 2) -> Will fail due to comma between numbers understood as decimals.
I solved this by using strings around the numbers to interpret them correctly as numbers and comma being interpret correctly as function seperators.
Mid([Item Data.CPR], "3", "2")
Is there a better way of doing this? I do like my computer on english language (easier to find help for random errors) and I like to use danish decimal seperator (comma).
In advance thanks 🙂
Answered! Go to Answer.
Helpful Answers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-03-22 10:49 AM
Mid([Item Data.CPR] , 3 , 2)
Can you try this and see if it improves your situation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-03-22 10:49 AM
Mid([Item Data.CPR] , 3 , 2)
Can you try this and see if it improves your situation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-03-22 11:32 AM
To use space as a delimiter is much easier than making it a string, good answer! Still it's very annoying that BP functions fails when using them directly due to comma being both delimiter and comma separator. Guess I'm creating problems for myself when mixing and matching numbers and string languages, trying to get the best from both worlds 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-03-22 01:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-03-22 02:24 PM
What happens if you use all data elements/variables in your function? I tend to do this as a personal practice, even if I expect the value to remain constant (say, a process name, a URL, height or width). In your example, use a multi-calc stage with
3 -> [Search]
2 -> [Replace]
Then your function becomes: Mid([Item Data.CPR], [Search], [Replace])
More curiosity than an intended solution. Good luck.
Red
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-04-22 11:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-04-22 12:13 PM
Hi John,
Thanks for looking into this. I think the reason is that both the decimal separator and variable separator are a comma (","). This means BP has a problem as xyz(123,123) can be interpreted as either 1 input with a decimal number or as two inputs with integer numbers. When there are ambiguity it's obviously hard for any program to make a logical decision. The way to make it non-ambiguous was as you said, put in a space, this will show it's not a decimal xyz(123, 123), hence it can only be a separator. This is my guess on this underlying problem 🙂
Hi Robert
If I use data items (variables) there are no problems. This is interpreted correctly.
