How do add a $ sign and the field value to a shorcode? Currently if i put a $ in the shortcode it breaks the code. ANd if i put it in the as static text it always displays even when the field is empty.
I'm not sure which kind of field you are trying to output, but for simple fields when you insert them using the Fields and Views button you will see an option for formatting where you can insert the $ sign, and that will generate a shortcode with a format attribute, like so:
thanks for your response, though I am using advanced custom fields number field. So when i click views and fields, then i click "Load non-Types custom fields"
We don't have any options for formatting non-Types fields.
If you want to conditionally show a $ sign only when a non-Types field is not empty then you would need to wrap the whole section (the $ sign and the wpv-post-field shortcode used to output the number) in a conditional statement that first tests whether there is a value set for the number field.
If inserting via the GUI in your case the source will be the wpv-post-field shortcode, where you will have to manually add the field name once it is inserted.