[fpc-pascal] Currency symbol wrong location
Hi, I want to format a float number to currency. To do this, I use the Format function using the %m format, as this: Format('%m', [123.25]); I'm using Ubuntu 12.04 and my regional settings at configured to display "$ 1234.25", but I'm getting "123.25$", why is the money symbol at the right side, instead of using the regional setting?. Leonardo M. Ramé http://leonardorame.blogspot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] [Patch] there is a small bug in fcl-image imterpolation
in packages/fcl-image/src/fpinterpolation.inc when it calculates the interpolated color it must initialize the value of the variable NewCol with a quadruple of all zero but it actually uses colBlack which has RGB set to zero but alpha is $. This is wrong. It makes it impossible to scale any image with alpha channel (the colors are fine but the alpha channel will be messed up completely. This patch fixes it: Index: packages/fcl-image/src/fpinterpolation.inc === --- packages/fcl-image/src/fpinterpolation.inc (Revision 21487) +++ packages/fcl-image/src/fpinterpolation.inc (Arbeitskopie) @@ -179,7 +179,7 @@ begin sx:=PInteger(xEntry)^; inc(xEntry,SizeOf(integer)); - NewCol:=colBlack; + NewCol:= colTransparent; for cx:=0 to xSupport-1 do begin f:=PSingle(xEntry)^; @@ -198,7 +198,7 @@ for dx:=0 to w-1 do begin CurEntry:=yEntry+SizeOf(integer); -NewCol:=colBlack; +NewCol:=colTransparent; for sy:=0 to ySupport-1 do begin f:=PSingle(CurEntry)^; Instead of starting with colBlack which is (0,0,0,$) it must start with colTransparent which is (0,0,0,0) After applying this patch I can now properly scale images with alpha channel. Bernd ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Currency symbol wrong location
On Sat, 9 Jun 2012, Leonardo M. Ramé wrote: Hi, I want to format a float number to currency. To do this, I use the Format function using the %m format, as this: Format('%m', [123.25]); I'm using Ubuntu 12.04 and my regional settings at configured to display "$ 1234.25", but I'm getting "123.25$", why is the money symbol at the right side, instead of using the regional setting?. Did you use the CLocale unit ? Michael.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Currency symbol wrong location
- Original Message - > From: Michael Van Canneyt > To: Leonardo M. Ramé ; FPC-Pascal users discussions > > Cc: > Sent: Saturday, June 9, 2012 11:59 AM > Subject: Re: [fpc-pascal] Currency symbol wrong location > > > > On Sat, 9 Jun 2012, Leonardo M. Ramé wrote: > >> Hi, I want to format a float number to currency. To do this, I use the > Format function using the %m format, as this: >> >> Format('%m', [123.25]); >> >> I'm using Ubuntu 12.04 and my regional settings at configured to > display "$ 1234.25", but I'm getting "123.25$", why is > the money symbol at the right side, instead of using the regional setting?. > > Did you use the CLocale unit ? > > Michael. > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal > No, but after you mentioned I included it in my "uses". The result was a number without the money symbol. Leonardo M. Ramé http://leonardorame.blogspot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Currency symbol wrong location
- Original Message - > From: Leonardo M. Ramé > To: FPC-Pascal users discussions > Cc: > Sent: Saturday, June 9, 2012 12:31 PM > Subject: Re: [fpc-pascal] Currency symbol wrong location > > - Original Message - > >> From: Michael Van Canneyt >> To: Leonardo M. Ramé ; FPC-Pascal users > discussions >> Cc: >> Sent: Saturday, June 9, 2012 11:59 AM >> Subject: Re: [fpc-pascal] Currency symbol wrong location >> >> >> >> On Sat, 9 Jun 2012, Leonardo M. Ramé wrote: >> >>> Hi, I want to format a float number to currency. To do this, I use the > >> Format function using the %m format, as this: >>> >>> Format('%m', [123.25]); >>> >>> I'm using Ubuntu 12.04 and my regional settings at configured to >> display "$ 1234.25", but I'm getting "123.25$", why > is >> the money symbol at the right side, instead of using the regional setting?. >> >> Did you use the CLocale unit ? >> >> Michael. >> ___ >> fpc-pascal maillist - fpc-pascal@lists.freepascal.org >> http://lists.freepascal.org/mailman/listinfo/fpc-pascal >> > > No, but after you mentioned I included it in my "uses". The result was > a number without the money symbol. > Apart from that, I'm looking a cross-platform solution. Leonardo M. Ramé http://leonardorame.blogspot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Currency symbol wrong location
On Sat, 9 Jun 2012, Leonardo M. Ramé wrote: - Original Message - From: Michael Van Canneyt To: Leonardo M. Ramé ; FPC-Pascal users discussions Cc: Sent: Saturday, June 9, 2012 11:59 AM Subject: Re: [fpc-pascal] Currency symbol wrong location On Sat, 9 Jun 2012, Leonardo M. Ramé wrote: Hi, I want to format a float number to currency. To do this, I use the Format function using the %m format, as this: Format('%m', [123.25]); I'm using Ubuntu 12.04 and my regional settings at configured to display "$ 1234.25", but I'm getting "123.25$", why is the money symbol at the right side, instead of using the regional setting?. Did you use the CLocale unit ? Michael. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal No, but after you mentioned I included it in my "uses". The result was a number without the money symbol. That probably means the clocale does not know how to handle the currency symbol ? Michael.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Currency symbol wrong location
In our previous episode, Leonardo M. Ram? said: > Hi, I want to format a float number to currency. To do this, I use the Format > function using the %m format, as this: > Format('%m', [123.25]); >I'm using Ubuntu 12.04 and my regional settings at configured to display "$ >1234.25", but I'm getting "123.25$", why is the money symbol at the right >side, instead of using the regional setting?. This is as per doc? http://www.freepascal.org/docs-html/rtl/sysutils/format.html FloatToStrF(Argument,ffGeneral,Precision,3) MCurrency format. the next argument in the var{Args} array must be a floating point value. The argument is converted to a decimal string using currency notation. This means that fixed-point notation is used, but that the currency symbol is appended. If precision is specified, then then it overrides the CurrencyDecimals global variable used in the FloatToStrF In short, the M specifier formats it's argument as follows: FloatToStrF(Argument,ffCurrency,,Precision) Note the /append/ :-) ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
RE : [fpc-pascal] Currency symbol wrong location
> This is as per doc? > > http://www.freepascal.org/docs-html/rtl/sysutils/format.html > > FloatToStrF(Argument,ffGeneral,Precision,3) > > MCurrency format. the next argument in the var{Args} > array must be a > floating point value. The argument is converted to a decimal > string using currency notation. This means that fixed-point > notation is used, but that the currency symbol is appended. > If precision is specified, then then it overrides the > CurrencyDecimals global variable used in the FloatToStrF > > In short, the M specifier formats it's argument as follows: > > FloatToStrF(Argument,ffCurrency,,Precision) > > Note the /append/ :-) > Then there seems to be a contradiction in the doc. The position of the currency symbol in FloatToStrF with ffCurrency is determined by CurrencyFormat. CurrencyFormat:=0; s:=FloatToStrF(123.25,ffCurrency,5,2); s:=Format('%m', [123.25]); Both calls return $123.25 in s. Ludo ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: RE : [fpc-pascal] Currency symbol wrong location
- Original Message - > From: Ludo Brands > To: 'FPC-Pascal users discussions' > Cc: > Sent: Saturday, June 9, 2012 12:54 PM > Subject: RE : [fpc-pascal] Currency symbol wrong location > >> This is as per doc? >> >> http://www.freepascal.org/docs-html/rtl/sysutils/format.html >> >> FloatToStrF(Argument,ffGeneral,Precision,3) >> >> M Currency format. the next argument in the var{Args} >> array must be a >> floating point value. The argument is converted to a decimal >> string using currency notation. This means that fixed-point >> notation is used, but that the currency symbol is appended. >> If precision is specified, then then it overrides the >> CurrencyDecimals global variable used in the FloatToStrF >> >> In short, the M specifier formats it's argument as follows: >> >> FloatToStrF(Argument,ffCurrency,,Precision) >> >> Note the /append/ :-) >> > > Then there seems to be a contradiction in the doc. The position of the > currency symbol in FloatToStrF with ffCurrency is determined by > CurrencyFormat. > > CurrencyFormat:=0; > s:=FloatToStrF(123.25,ffCurrency,5,2); > s:=Format('%m', [123.25]); > > Both calls return $123.25 in s. > > Ludo > Thanks, that worked. The trick was CurrencyFormat := 0; Leonardo M. Ramé http://leonardorame.blogspot.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Playing sounds with standard components
Hello all, Bass is a very good library for sound playing and recording. However, it's not included as an standard feature of Freepascal. For whom wich wants to work with standard components, are there other options: (1) to play sounds and (2) to record sounds? Regards, Luciano ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Playing sounds with standard components
You can use OpenAL or SDL... 2012/6/9 luciano de souza : > Hello all, > > Bass is a very good library for sound playing and recording. However, > it's not included as an standard feature of Freepascal. For whom wich > wants to work with standard components, are there other options: (1) > to play sounds and (2) to record sounds? > > Regards, > Luciano > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Playing sounds with standard components
Our company uses SDL with good results in our cross-platform projects. -- Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal