Asset Attribute Integers adding zeros


(Nic Hubbard) #1

I have a strange problem. On a custom asset I am working on, that has an integer field, when printing this in an asset listing, the correct integer gets printed, but .000000 get printed after it. So, if the number was 480, it would print 480.000000. This is strange because on the details screen of the asset it is correctly 480. Why would printing it add those zeros?


I don't get where this problem is coming from…and strangely printing integer fields on the mp3 asset does this as well…



Ideas?


(Huan Nguyen) #2

I can confirm that this problem exists, i just tried on my 3.18.7 system, the value of an int get saved into the DB as double. I'l look into this issue tomorrow when i get to work.


(Nic Hubbard) #3

Thanks Huan, I appreciate it. :)

Just a note. It must only have to do with certain asset types. Image Files use an integer field for height and width, and I use those keywords all the time and have never experienced this.

And in my testing, it seems this problem is only happening randomly...

(Huan Nguyen) #4

Hey Nic, I can not reproduce this problem on a number of systems at work, including 3.18.7. I guess this would related to environment configuration rather than problem with Matrix. I would have to debug on my home system, maybe it's issue related to db/ pdo driver, but I couldn't find anything related on the net either.


(Nic Hubbard) #5

Thanks for checking in this Huan. The system I am having an issue with is 3.20.1 running on OSX, so, maybe that is the problem. I tried this on a Debian 3.20.1 system and there was no problem, so I think you are right about the environment config.

(Nic Hubbard) #6

Does anyone have any additional ideas on this? It seems that a lot of my integers and floating point numbers are off, and it is really screwing up my testing…I am wondering if it is OSX.


Huan, what OS are you running where you had this issue?



UPDATE: Ok, I figured it out. It was my fault. These fields that I was having problems with needed to be float attribute types rather than int. :slight_smile:


(Huan Nguyen) #7

My Matrix install running on Ubuntu 8, postgres 8.3, php5.3. The problem I have happen for a "Comment" asset, where the rating is supposed to be int (20, 40, 60…) but it is saved as double in the db. I haven't got time to troubleshoot at home yet. Glad you figured out.