December 4, 200124 yr I want to display a number field on a page (a price). The field is in my main DB through a relationship. The field appears unformatted (5.2 instead of 5.20)on the web. I tried specifying a number format on the layout that I use (in the main DB), it didn't change the format on the web. How can I specify the number of decimal to display on the web ? Thanks
December 5, 200124 yr Author I am not using Instant Web Publishing. (I am using Custom Web Publishing) I would have liked to avoid using a calculation field but if it is the only way.... Thanks
December 5, 200124 yr Try entering the value in the field as 5.20 and seeing if it displays that way on the web. That'll tell you that the web displays exactly as they are entered.
December 5, 200124 yr Here is one I use: "$" & Left(NumToText(Round(selling_price_ex,2)+0.0001),Length(NumToText(Round(selling_price_ex,2)+0.0001))-2) I'm looking for a better way. So any advice appreciated! All the best. Garry
December 6, 200124 yr Maria Langer, in her book Database Publishing with FileMaker Pro on the Web, provides such a calculation on page 317. Only problem is she has written it incorrectly. But it is easy enough to fix because it is so obvious.
December 17, 200124 yr if you are using dreamweaver to make the cdml pages there is an option to enter preformatted text. using this you can select the fmp replacement tag and click on the style menu on the selection properties there are other options such as heading or paragraph. selecting preformatted will enter the text the way it is formatted in filemaker eg bold italic of number formats
August 1, 200223 yr I think he meant [fmp-field: fieldname, encoding] FWIW, on seeing that I opened my copy of the Sample File which Stephen posted for me under "Summary Field thru cdml". I stuck the following on one of the results format files: <p>[fmp-field: totcost, raw] <p>[fmp-field: totcost, break] <p>[fmp-field: totcost, url] <p>[fmp-field: totcost, html] The field, totcost, is a summary field. In the db it is formatted to display the dollar sign and decimal point with two places. Thus in the db a summary might appear as $38.80. In the solution and the format file into which I wrote these four lines, each returned 38.8 to the browser. However, the solution as I offered it does display the number (as text) in the format $38.80 which is what is displayed on the browser screen. So if [fmp-field: fieldname, encoding] is what was meant, then the answer to the question which accompianied that is "No".
August 2, 200223 yr It is not there Just try it. It mostly works, although I didn't make the syntax working from related fields.
August 2, 200223 yr Anatoli seems insistant on [fmp-field: fieldname, format]. I like that. So I went to the same place on the same format file and wrote [fmp-field: totcost, format]. I then ran through the browser solution and - shut my mouth - there on the browser was $38.80 in response to the tag. Anatoli, Tres cool.
August 2, 200223 yr I must admit, that I didn't discovered that myself I inherited some spaghetti like code, tangled all together especially JavaScript and CDML. But it works. It is horrible to add or modify something, but it works. Something is so slow, like 17 sec for search, instead of my usual 1 sec. Mistakes. But there was sitting this undocumented gem
August 7, 200223 yr There is the problem with WebCompanion when serving the FORMAT number from PORTAL like [FMP-field:PODtl::QOTL, Format] The designer of WebCompanion wrongly used old syntax for specifying size of FONT. WC is inserting automatically the <FONT FACE="Arial" SIZE="-1"> syntax just before the Number with FORMAT in Portal. That is most unfortunate, because that syntax is modifying user Font and it tries to modify also size. Remedy for this is CSS. Just put in head of your document: <style type="text/css" media="screen"><!-- FONT { font-size: 12px; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular } --></style> and all should be fine. Obviously, you must use CSS formatting through page. That is also preferred way of handling Fonts and Sizes on web for past 3 years.
Create an account or sign in to comment