Skip to main content

Questions tagged [money]

A data type to store monetary values

Filter by
Sorted by
Tagged with
0 votes
1 answer

How to convert numeric to Polish currency

In PostgreSQL I would like to achieve something similar to mysql query: select price, format(price,2,'pl_PL') as pricePL from table *************************** 1. row *************************** ...
Radoslaw's user avatar
0 votes
1 answer

Default value format of a stored procedure parameter(of datatype : money)

With my query: SELECT (CAST(0.00 AS MONEY)) I am expecting a result : 0.00 But it shows me the result: 0,00(with comma) I checked this query ,when i found that,the CREATE PROCEDURE script ...
minijebu's user avatar
3 votes
4 answers

Handling currencies in a database

How should money currency be handled in the database to be consistent? Should I choose the specific currency to use across my database or is it better to mix different values of different currencies? ...
Konrad's user avatar
  • 209
0 votes
1 answer

What is the best data type to store prices upto 8 decimals + indicators in SQLite?

I am developing a trading system which stores data in SQLite, consisting of OHLC and volume. I would also like to store some indicators like RSI etc I read the other answer which indicated integers as ...
PirateApp's user avatar
  • 296
0 votes
1 answer

Handling differences between MS-SQL and PostgreSQL money datatypes

This is a follow-up/ to my previous question Is it possible to insert un-formatted data for money data type in PostgreSQL I could read money data by typecasting it into numeric SELECT '52093.89'::...
Ramesh Bathini's user avatar
5 votes
2 answers

Is it possible to insert un-formatted data for money data type in PostgreSQL

By default, PostgreSQL's money data type inserts values with currency code and grouping. I have observed that it always inserts values with $. How can I insert locale specific values? How can I ...
Ramesh Bathini's user avatar
7 votes
1 answer

ERROR: invalid input syntax for type money

While importing I get this error: pg_restore: [archiver (db)] COPY failed for table "transaction_details": ERROR: invalid input syntax for type money: "$0.00" restore completed, but the ...
Akash Kumar's user avatar
4 votes
1 answer

Exchange rate table and conversion on the fly in query

I'm working on a small project and I'm have arrived to the point where I let a user chose in which currency to display items. I'm working with Java and my first thought was that I would use some kind ...
Alexis's user avatar
  • 279
11 votes
1 answer

PostgreSQL and MONEY data type for currency values

For a project, I created a table with a column price MONEY NOT NULL column. And I thought it would handle decimals properly, unlike a floating number (i.e. IEEE rounding issues), but I end up having ...
Yanick Rochon's user avatar
0 votes
0 answers

Storing currency with variable floating point in SQLite

We are working with currency and handle currencies from various countries. As a result, we may work with currencies that require no decimal values, two decimal places, three, sometimes four. We also ...
MxLDevs's user avatar
  • 339
10 votes
3 answers

Efficiently comparing prices in different currencies

I want to make it possible for user to search products within a price range. User should be able to use any currency (USD, EUR, GBP, JPY, ...), no matter what currency is set by the product. So, the ...
Taai's user avatar
  • 210
23 votes
2 answers

Storing prices in SQLite, what data-type to use?

I am using SQLite and need to store prices. SQLite's REAL data-type says it uses floating-point which is unacceptable storage for prices. Is there a data-type besides TEXT that I can use to store ...
unixman83's user avatar
  • 333
7 votes
3 answers

How to change the datatype of a column from integer to money?

I am attempting to convert a PostgreSQL table column from integer to money, but I am receiving the error: cannot cast type MyColumn to money I have tried these two statements, but just haven't ...
Gabriel's user avatar
  • 71
2 votes
1 answer

How can I alter the type of a money-column to decimal in PostgreSQL?

I have a table in PostgreSQL where one column "vat" has type money but I would like to alter it to decimal instead. How can I do it? I tried with: alter table my_table alter column vat type decimal;...
Jonas's user avatar
  • 33.1k