Jump to content

Formating numbers


This topic is 8022 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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 smile.gif" border="0

Link to comment
Share on other sites

  • 7 months later...

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".

Link to comment
Share on other sites

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. wink.gif

Link to comment
Share on other sites

I must admit, that I didn't discovered that myself smile.gif

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 smile.gif

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 8022 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.