I have a content type with an integer field. The integer has a prefix of $.

The fields display correctly in my view but the calc row (which totals them) does not display the prefix.

There are hacky ways to fix this but it would be ideal if the module respects field prefix/suffix.

Thanks !

Files: 
CommentFileSizeAuthor
#6 views_calc.patch3.33 KBdunix

Comments

Category:bug» feature

This sounds easy but is not. We can't run an arbitrary value through the formatter that adds these things. I'll make this a feature request in case some one can figure out a way to make it work and provide a patch. But I couldn't see a way to do it.

Understandable. As an alternative, is there any chance to set a custom prefix / suffix for each calc field ?

That's probably the only way this can work. Do you want to supply a patch?

Unfortunately i am not a sufficiently experienced drupal developer to make such a patch.

I am having a similar issue.... my integer field has % sign at its end... views calc does not perform aggregation on it at all..

Status:Active» Needs review
StatusFileSize
new3.33 KB

This patch allows for setting a custom prefix/suffix for each column that has a calc field.

Thank to dunix for the patch. It works but instead of respecting to the fields' prefixes and suffixes, you have to set the prefix and suffix for each column in Settings of Views Calc Table.

Thanks. Works great!

Works great. Anyway to add a field for moving the decimal also?

When working with prices, it automatically moves the decimal over 2 so 10000 becomes $100.00 etc.

Then when I run it through the table, the output changes it back to 10000. If I put the dollar sign in front, I'm still stuck with $10000.