I need to have price field which will display a price field. This field is a number with the dollar sign (i.e. $200). In my view, this price field will be used for sorting also.

I have installed and enabled the currency module and the currency API.

Via structure > content type > manage fields > I tried to add a new field. But the list of field types do not have the 'currency option'. So I am not sure how I should add the currency field with a dollar sign.

My question: How can I add a field to a content type which will accept a price value in the format of a currency?

1 Answer 1



using Views field rewrite:

on the field in the view setup, in the "rewrite results" section of the editing modal select the checkbox "Rewrite the output of this field" then scroll down and open the fieldset "REPLACEMENT PATTERNS" and use the pattern there to rewrite your field in the above textarea. as an example to put a "$" in front of the users uid I used $[uid]

image to help:

CCK field prefix:

You may just want to use a field that is for currency but doesn't actually include the currency symbol, so it can be saved as a number, which allows for better sorting. Then using views you can set a prefix to a displayed field of the desired currency symbol. This may only work with CCK fields.

  • Currently, I added a number field 'price'. Now, this field displays in the view. I can sort. I am not sure how I can prefix in the view for this field? If you can provide some details, it will be great. My site: www.bettylist.com/ac/myview
    – autop
    Commented Apr 6, 2015 at 18:20
  • I think the prefix option is only available for certain CCK fields. I am updating my answer with another method that should work: rewrite the field.
    – DrCord
    Commented Apr 6, 2015 at 18:25
  • I am not understanding by rewrite the field. I am new. Can you please provide some info?
    – autop
    Commented Apr 6, 2015 at 18:26
  • I added an image to help
    – DrCord
    Commented Apr 6, 2015 at 18:37
  • Please mark the answer as correct.
    – DrCord
    Commented Apr 6, 2015 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.