0

I am working on one project in which, query output gives ##,###,### instead of right values.

according to requirement we calculate the time period and display it in separate table.

this is query I am using as calculation

select (to_char((coalesce(11808000,0) - (coalesce(3562.66,0) - (coalesce(1800,0) + (coalesce(1800,0))))),'FM99,999,999'))::character varying as mytest

so if I run this one, it will give output properly, but the seperate table what we use to display output is giving wrong values. can any one help me with this ??

asked Jun 30, 2020 at 14:43
2
  • Works for me: dbfiddle.uk/… - but in general the output ##,###,### means your format mask was too short to handle the actual number. You need to increase the number of digits there, e.g. FM999,999,999 Commented Jun 30, 2020 at 14:45
  • Please add only a tag for the Postgres version you are really using. Commented Jun 30, 2020 at 14:45

1 Answer 1

0

If the output looks like ##,###,###, the number is too big for the format.

Use a longer format string like

FM99,999,999,999
answered Jun 30, 2020 at 14:46
1

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.