Re: Optimized verion of AddThousandSeparator



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