Search these areas:
Support Forums
Product Info

-DataWeb: What's New
-Creating an Application
-The DataWeb Designer
-Application Management
-Data Tables
-Data Tables
-Data Analysis
-Object Model
-Full-Text Search
-Domain and Email Hosting
-HotBlock Modules
-Account Management
-New Responsive UI Module

DataWeb Help
Support Forums
Script Library
Knowledge Base

Home > Support

Support Forum

How do I put a $ (dollar sign) in front of a field value in a grid?
KevinNicholls asked:
Hopefully this is self explanitory- email me back if not.  
  dougl responded:
  There are two good ways to do this:

The first (the UI answer):
1. Select your field( salary, for example). Set it to display only in insert and update mode.
2. Copy your field. Set the copy to display only in details and grid mode.
3. On the Details and Grid copy, click the magic wand next to the "Bound Field" property.
4. At the bottom of the Field Builder form, add the following text to your "Enter a Field" input:
dolSal="$" + [salary]
5. this may also be appropriate:
dolSal="$" + [salary] + ".00"
6. click "Finish"
  dougl responded:
  The Second (the SourceView answer):
1. Select your field( salary, for example). Set it to display only in insert and update modes.
2. Click the source-view tab at the top of the designer. Find your cursor. It should be on the correct <ws:field> tag.
3. Beneath this field, add the following XML:
<ws:field name="salary" displaymodes="details, grid"><ws:select value="#record.salary#">$#record.salary#.00</ws:select></ws:field>
4. Save and check syntax.
  matthewb responded:
  You're on a roll Kevin.  This is also a v2 feature. 

The advantage of the v2 solution over the v1 workaround is that sorting will not affected.
  KevinNicholls responded:
  Not having much luck:

First attemp throught the GUI
fmtSpend="$" + [HistSpend]

I first tried the $ sign- but thought it might mean something to a parser, so I switched it to "blah" - still no change in result:

There is nothing but "#ERROR#" where ALL the data values should be (including other fields) and I get this error at the bottem of the page:

Errors occurred opening table 'vwSubscriberDealDtl'. This can occur if the filter syntax is invalid, or there is an error in a calculated column.

Could the fact that the underlying field is a decimal and I am trying to format text have anything to do with this?

Now for the source code attempt: I get the number twice "$30003000.00".
My code:
<ws:field name="HistSpend"><ws:select value="#record.HistSpend#">$#record.HistSpend#.00</ws:select>
<ws:caption>Hist. Spend</ws:caption></ws:field>

Thanks in advance for help.
  KevinNicholls responded:
  I ended up putting a <ws:select>$</ws:select> in the field area, and this is works for me.  
  dougl responded:
  How embarrasing... I was a little sloppy with my previous answers. Here's some more complete information.

First, check out the support conversation:
which covers this same type of question.

Edit my source-code solution above to say:
<ws:field name="salary" displaymodes="grid,details"><ws:select><ws:option value="#record.salary#">$#record.salary#</ws:option></ws:select></ws:field>

The UI (calculated expression) answer needs a little work.

The first part is the decimal-to-string conversion. Try this instead:
dolSal="$" + lcase([salary])

You'll find you get a lot of zeros after the decimal. I'm working on a solution for this and I'll post the answer shortly.
  dougl responded:
  Looks like I don't have a good calculated-field answer to this question.  
  dougl responded:
  DataWeb considers this issue closed.
If you have additional questions or comments about this issue, please open it again.
If you have questions about a different topic please open a new support question.

DataWeb Support
  Please Log On
or create your own DataWeb Account.
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
DataWeb, 720 North 10th Street, A #145, Renton, Washington 98057 *425-583-5970* Fax 484-770-4706* Email Us