Top Experts [
learn more
]
Top 4-10
webko
9743 K
bandmandq
2458 K
Genx
1525 K
4.
tcmeyers
5.
kbata
6.
Martie
7.
Hammerton
8.
rrenfrow
9.
bneeman
10.
plegler
Welcome,
Guest
. Please
login
or
register
.
May 22, 2013, 04:07:52 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Welcome to the FileMaker Web Masters Exchange. If you have any questions about how to use this forum, please watch the getting started movie at:
http://www.fmwebschool.com/movies/forum1/forum1.html
27461
Posts in
6064
Topics by
1523
Members
Latest Member:
donok
fmwebschool.com
FMStudio
FMStudio
Show negative numbers "red" transferred by PHP ?
0 Members and 1 Guest are viewing this topic.
« previous
next »
Pages:
[
1
]
Author
Topic: Show negative numbers "red" transferred by PHP ? (Read 1058 times)
fraank
Jr. Member
Offline
Posts: 65
Applications:
FMStudio
(User)
FMStudio PDF
(Novice)
Show negative numbers "red" transferred by PHP ?
«
on:
July 19, 2009, 02:01:39 PM »
HI,
what would be the easiest solution to format negative numbers that are transferred via PHP from my filemaker database to be displayed in red ?
I´ve heard that all formatting won´t be processed via Filemaker ...
Thanks for an idea.
Frank
Logged
webko
Global Moderator
Hero Member
Offline
Posts: 2050
Kudos: 9743
Applications:
FX.php
(Guru)
BlackBelt
(Expert)
PHP API
(Advanced)
Re: Show negative numbers "red" transferred by PHP ?
«
Reply #1 on:
July 19, 2009, 03:07:07 PM »
Try:
Code:
<?php
If (
$myFileMakerField
<
0
) {
$style
=
" color='red'"
; } else {
$style
=
""
; }
?>
<p
<?php
echo
$style
;
?>
>
<?php
echo
$myFileMakerField
;
?>
</p>
Logged
tim.webko_at_gmail.com
PhanMan
Full Member
Offline
Posts: 137
Re: Show negative numbers "red" transferred by PHP ?
«
Reply #2 on:
June 29, 2012, 03:50:06 PM »
Code:
<?php
if (
$feed_row
->
getField
(
'chg_today_fm'
) <
0
) {
$style
=
"color='red'"
; } else {
$style
=
""
; }
?>
<p
<?php
echo
$style
;
?>
>
<?php
echo
"$"
.
number_format
(
$feed_row
->
getField
(
'chg_today_fm'
),
2
,
'.'
,
','
);
?>
</p>
however it is now showing up red for the negative fields. any suggestions?
Logged
webko
Global Moderator
Hero Member
Offline
Posts: 2050
Kudos: 9743
Applications:
FX.php
(Guru)
BlackBelt
(Expert)
PHP API
(Advanced)
Re: Show negative numbers "red" transferred by PHP ?
«
Reply #3 on:
July 01, 2012, 09:31:54 PM »
Now you're digging into ancient history - I note that I stuffed up the code in the original answer too...
Instead:
Code:
<?php
if (
$feed_row
->
getField
(
'chg_today_fm'
) <
0
) {
$style
=
" style=\"color: red\""
; } else {
$style
=
""
; }
?>
<p
<?php
echo
$style
;
?>
>
<?php
echo
"$"
.
number_format
(
$feed_row
->
getField
(
'chg_today_fm'
),
2
,
'.'
,
','
);
?>
</p>
Cheers
Webko
Logged
tim.webko_at_gmail.com
PhanMan
Full Member
Offline
Posts: 137
Re: Show negative numbers "red" transferred by PHP ?
«
Reply #4 on:
July 02, 2012, 08:12:02 AM »
thanks webko!!! that worked
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Discussion and Announcements
-----------------------------
=> FMWebschools updates and announcements
===> FMWebschool Training Schedule
=> Newsletter and Community Discussion
=> Webinar and FMWebschool Events
=> General Discussion
===> CDML Old School FileMaker Web Publishing
===> FileMaker Mobile 7/8
=> Holiday Special Product Support
-----------------------------
FMTouch
-----------------------------
=> FMTouch - FileMaker Databases on the iPhone and iPod iTouch
===> FMTouch - Multi Language Discussion
=> FMTouch BlackBerry and FileMaker
-----------------------------
FMStudio
-----------------------------
=> FMStudio
===> FMStudio Connection and Installation Problems
=> FMStudio Pro
-----------------------------
FMWebschool Products and Solutions
-----------------------------
=> Dolphin Shopping Cart System
=> BlackBelt CDML Software
-----------------------------
FileMaker Books
-----------------------------
=> FileMaker Book Questions and Suggestions
-----------------------------
PHP Web Publishing Technologies
-----------------------------
=> FileMaker's New PHP API
=> FileMaker PHP, FX.php custom web publishing
===> Ajax Code and Examples
-----------------------------
FileMaker Inc Products and Technologies
-----------------------------
=> FileMaker Server 9
===> FileMaker Server 7 / 8 Advanced
=> Web Viewer
=> Instant Web Publishing
=> FileMaker XML, XSLT
-----------------------------
Other Resources
-----------------------------
=> Search Engine Optimization and Consulting
===> Marketing Book Reviews
=> FileMaker Web Resources
=> Free JavaScript Code Snips
=> Free PHP Code Snips
=> Web Jobs, Web Consulting
Loading...