Closed (outdated)
Project:
Views (for Drupal 7)
Version:
7.x-3.7
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Aug 2013 at 02:33 UTC
Updated:
28 Feb 2019 at 01:25 UTC
Jump to comment: Most recent
Comments
Comment #1
lionsharz commentedAh! I think I discovered why. The field being pulled in contains a currency symbol (€100) so its not just numbers. It feeds to a custom test field ok.
Anyone got any advice on how to strip out that currency symbol? Or rewrite the output of the field somehow?
Comment #2
merlinofchaos commentedThe simplest, if not very elegant way to achieve this is to make an alternate version of the field that is set to 'exclude' so it doesn't display, and turn off all formatting so that you get a raw number.
Comment #3
lionsharz commentedYep - that did the trick. Ran into a similar problem with the maths field becoming confused by civicrm's thousand separater (comma by default - and cannot be blank) Used this method for that too.
EDIT
Unfortunately I've double checked and this didn't work as I originally thought. The output in the custom maths field still contains the comma. It is simply feeding in the raw output of the original field and outputting it the same way.
I don't know how to "unformat" or otherwise remove the comma. Any ideas?
Comment #4
lionsharz commentedComment #5
lionsharz commented...the 'source' field (where the data gets fed in first) is being pulled in from civicrm. Unfortunately there is no option to remove the thousand separator (you can use either a comma or a space) there in civi. So whatever happens the field is going to contain this output with the comma.
This is going to throw the Global: Maths field as it only recognizes the first number up to the comma or space.
Therefore, I think I need something that will re-write the output in a conditional way, like if the number contains a space and/or comma, then strip these out and leave the number only.
Maybe there's a module for s'thing like this... conditional text formatting or similar...(?)
Comment #6
lionsharz commentedHi
I know this is old but can anyone help me out with this? I have to revisit the issue now and I can't figure out how to convert currencies into numbers.
Maybe it could be done with a simple PHP string...?
Any pointers much appreciated :)
Comment #7
mustanggb commentedClosing this as outdated to tidy up a bit around here. If you're still having problems with the latest release please create a new issue.