Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using float datatypes to store data #467

Open
jaragunde opened this issue Feb 12, 2020 · 0 comments
Open

Avoid using float datatypes to store data #467

jaragunde opened this issue Feb 12, 2020 · 0 comments

Comments

@jaragunde
Copy link
Member

There are certain kinds of data that we are storing using floating-point datatypes. We should generally avoid that, as they are imprecise and we could lose data. We should analyze it case by case.

One example:

create table project (
  id                        serial not null,
  activation                boolean default true not null,
  init                      date,
  _end                      date,
  invoice                   double precision,
  est_hours                 double precision,
  areaId                    integer not null,
  description               varchar(256),
  type                      varchar(256),
  moved_hours               double precision,
  sched_type                varchar(256),
  constraint pk_Project primary key (id)
) ;

We could store the "invoice" as an integer of cents, and hours as integers of minutes like we do for tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant