Re: Optimized verion of AddThousandSeparator
- From: Soeren Muehlbauer <soeren.dd@xxxxxx>
- Date: Thu, 10 Apr 2008 12:13:05 +0200
Hi,
FormatFloat is an overloaded function and can called with TFormatSettings. In TFormatSettings you can set the ThousandSeparator. This is a threadsave way to override the standard behavior.
Soeren
.kDecimalSeparator : Char ; // keep
....
DecimalSeparator := '.' ; // in DK we normally use ','
something := ' Stardate: ' + FormatFloat('#.0',Now) ; // now it uses '.'
as decimal separator
DecimalSeparator := kDecimalSeparator ; // restore system settings.
You just have to do the same with the ThousandsSeparator as Remy
mentions.
This is not acceptable, because software is heavily multi threaded and all other parts must not be affected with this.
And using critical section etc, is not an option here.
I think I need to use someting different. Code I send earlyer works, but is not very efficient, thats all...
-TP-
- Follow-Ups:
- Re: Optimized verion of AddThousandSeparator
- From: Tommi Prami
- Re: Optimized verion of AddThousandSeparator
- From: Tommi Prami
- Re: Optimized verion of AddThousandSeparator
- References:
- Optimized verion of AddThousandSeparator
- From: Tommi Prami
- Re: Optimized verion of AddThousandSeparator
- From: Remy Lebeau \(TeamB\)
- Re: Optimized verion of AddThousandSeparator
- From: Tommi Prami
- Re: Optimized verion of AddThousandSeparator
- From: Remy Lebeau \(TeamB\)
- Re: Optimized verion of AddThousandSeparator
- From: Tommi Prami
- Re: Optimized verion of AddThousandSeparator
- From: Stig Johansen
- Re: Optimized verion of AddThousandSeparator
- From: Tommi Prami
- Optimized verion of AddThousandSeparator
- Prev by Date: Re: Optimized verion of AddThousandSeparator
- Next by Date: Re: Optimized verion of AddThousandSeparator
- Previous by thread: Re: Optimized verion of AddThousandSeparator
- Next by thread: Re: Optimized verion of AddThousandSeparator
- Index(es):