cinolas Posted December 4, 2001 Posted December 4, 2001 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
Anatoli Posted December 4, 2001 Posted December 4, 2001 Do calculation field with Num to Text and display the Text field on Web.
cinolas Posted December 5, 2001 Author Posted December 5, 2001 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
Vaughan Posted December 5, 2001 Posted December 5, 2001 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.
Garry Claridge Posted December 5, 2001 Posted December 5, 2001 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
Keith M. Davie Posted December 6, 2001 Posted December 6, 2001 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.
the walker Posted December 17, 2001 Posted December 17, 2001 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
Anatoli Posted August 1, 2002 Posted August 1, 2002 Can you try also [FMP-Field: Field name , Format]? It works in most (all?) cases
Garry Claridge Posted August 1, 2002 Posted August 1, 2002 I can't find that one in my "CDML Reference" database Garry
Keith M. Davie Posted August 1, 2002 Posted August 1, 2002 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".
Anatoli Posted August 2, 2002 Posted August 2, 2002 It is not there Just try it. It mostly works, although I didn't make the syntax working from related fields.
Keith M. Davie Posted August 2, 2002 Posted August 2, 2002 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.
Anatoli Posted August 2, 2002 Posted August 2, 2002 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
Anatoli Posted August 7, 2002 Posted August 7, 2002 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.
Recommended Posts
This topic is 8213 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now