Hello. I try to create some new ID-variables. Actually my datatype for pid/hid is "long". With MWE it will give you float, but illustrates the same problem.

Code:
clear
input   pid hid
        513 60313     
        513 60313
        513 94     
        513 94     
        514 167     
        514 175
        515 175     
        516 175             
end
I would like to multiply the first identifier by the maximum of the second and add this in order to create a unique new identifier. But I cannot figure out, what dataformat I should use.

Code:
gen pid_float = float(pid)
gen pid2 = pid_float*1000000
format pid2 %15.0f

gen hid_float = float(hid)
gen pid_hid = pid2+hid_float
format pid_hid %15.0f
list pid hid pid_float pid2 hid_float pid_hid

     +-----------------------------------------------------------+
     | pid     hid   pid_fl~t        pid2   hid_fl~t     pid_hid |
     |-----------------------------------------------------------|
  1. | 513   60313        513   513000000      60313   513060320 |
  2. | 513   60313        513   513000000      60313   513060320 |
  3. | 513      94        513   513000000         94   513000096 |
  4. | 513      94        513   513000000         94   513000096 |
  5. | 514     167        514   514000000        167   514000160 |
     |-----------------------------------------------------------|
  6. | 514     175        514   514000000        175   514000160 |
  7. | 515     175        515   515000000        175   515000160 |
  8. | 516     175        516   516000000        175   516000160 |
     +-----------------------------------------------------------+

How can I handle those numbers as normal numbers? Why is hid 60313 rounded to 60320? Thank you very much.