Firebird - function for decimals and thousands

Asked

Viewed 1,139 times

2

Is there any native function of the Firebird that returns me the same currency format as the Brazilian or some stored Procedure do this job.

Example: #.###,##

  • The point would be the thousand houses, millions etc.
  • The comma would be the decimal places, in case I wanted it to return two

In mysql would look like this:

select format(<atributo>,2,'de_DE')
  • http://answall.com/q/3455/91

  • @rray tried the two answers of this question but keeps returning me the point as decimal separator and neither appears the thousand separator :(

  • And in the case of this question he just wanted to visualize 3 decimal places, it’s not the same case

1 answer

2


Try that one cast(tb.SEU_FIELD AS NUMERIC(15,4)) as Saldo or cast( replace(tb.SEU_FIELD,',','.') as decimal(18,4))

These are the only ways I know to format the numbers.

  • Doctor Strange, it didn’t work, I’m running Firebird 2.5

  • Edit tries like this: cast(T1.VALOR_PAGTO AS NUMERIC(15,4)) Balance o ,4 is to four decimal places after comma

  • NOW YES !!! Uhuu!!!

  • Ops false positive, I was using Ibexpert and the result was already standard Portuguese Brazil then returned with the mask, but when playing like this in php for example it returns me a type value like: 1175.00

  • this is the example already said that solves, http://answall.com/q/3455/91 only not in my case

  • I did the test here and it works. I don’t know in PHP anymore in Delphi also does via programming. Probably there must be some fines in PHP that you are putting the number so you do not want.

  • I used Dbeaver to access the database and it worked, it might be something in PHP even

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.