Page 1 of 1

stop linebreak

Posted: Wed Jan 28, 2015 5:31 am
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?

Re: stop linebreak

Posted: Wed Jan 28, 2015 5:34 am
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()

Re: stop linebreak

Posted: Wed Jan 28, 2015 5:39 am
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);
}

Re: stop linebreak

Posted: Wed Jan 28, 2015 5:45 am
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;

Re: stop linebreak

Posted: Wed Jan 28, 2015 5:56 am
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

Re: stop linebreak

Posted: Wed Jan 28, 2015 6:03 am
by Celauran
jonnyfortis wrote:[text]nowrap="nowrap"[/text]
nowrap is obsolete. Use CSS instead.

Re: stop linebreak

Posted: Wed Jan 28, 2015 6:13 am
by jonnyfortis
Celauran wrote:
jonnyfortis wrote:[text]nowrap="nowrap"[/text]
nowrap is obsolete. Use CSS instead.
ok thanks