stop linebreak

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

stop linebreak

Post by jonnyfortis »

i have a line of echoed script

Code: Select all

<?php echo DoFormatCurrency($row_rsPayment['rental_price'], 2, ',', '.', '£ '); ?>
the trouble is its in a table with no cell widths and the output is showing

[text]£
79,00[/text]

i want it to show

[text]£ 79,00[/text]

how can this be done?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: stop linebreak

Post by Celauran »

DoFormatCurrency isn't a standard PHP function, so none of us will know what it actually does without seeing the code. You could use money_format() or number_format()
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

Re: stop linebreak

Post by jonnyfortis »

Celauran wrote:DoFormatCurrency isn't a standard PHP function, so none of us will know what it actually does without seeing the code. You could use money_format() or number_format()
sorry its

Code: Select all

function DoFormatCurrency($theObject,$NumDigitsAfterDecimal,$DecimalSeparator,$GroupDigits,$CurrencySymbol) { 
	$currencyFormat=$CurrencySymbol.number_format($theObject,$NumDigitsAfterDecimal,$DecimalSeparator,$GroupDigits);
	return ($currencyFormat);
}
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: stop linebreak

Post by Celauran »

jonnyfortis wrote:its in a table with no cell widths
Missed this.

CSS should fix it. Just apply this to the cell's class.

Code: Select all

white-space: nowrap;
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

Re: stop linebreak

Post by jonnyfortis »

Celauran wrote:
jonnyfortis wrote:its in a table with no cell widths
Missed this.

CSS should fix it. Just apply this to the cell's class.

Code: Select all

white-space: nowrap;
[text]nowrap="nowrap"[/text]

worked. thanks for that
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: stop linebreak

Post by Celauran »

jonnyfortis wrote:[text]nowrap="nowrap"[/text]
nowrap is obsolete. Use CSS instead.
jonnyfortis
Forum Contributor
Posts: 462
Joined: Tue Jan 10, 2012 6:05 am

Re: stop linebreak

Post by jonnyfortis »

Celauran wrote:
jonnyfortis wrote:[text]nowrap="nowrap"[/text]
nowrap is obsolete. Use CSS instead.
ok thanks
Post Reply