Skip to content

Commit

Permalink
Add note to redo the price parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
markwinter committed Oct 25, 2024
1 parent 9a474c2 commit 30ed9cd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions itch/5.0/ipo_quotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ func ParseIpoQuotation(data []byte) IpoQuotation {

releaseTime := binary.BigEndian.Uint32(data[19:23])

// TODO:
// Prices are given in decimal format with 6 whole number
// places followed by 4 decimal digits. The whole number
// portion is padded on the left with spaces; the decimal portion
// is padded on the right with zeroes. The decimal point is
// implied by position, it does not appear inside the price field

return IpoQuotation{
StockLocate: locate,
TrackingNumber: tracking,
Expand All @@ -96,11 +103,11 @@ func (i IpoQuotation) String() string {
"Tracking Number: %v\n"+
"Timestamp: %v\n"+
"Stock: %v\n"+
"Release Time: %vs\n"+
"Release Time: %ds\n"+
"Qualifier: %v\n"+
"Price: %v\n",
i.StockLocate, i.TrackingNumber, i.Timestamp,
i.Stock, i.ReleaseTime.Seconds(), i.Qualifier, float64(i.Price)/10000,
i.Stock, int64(i.ReleaseTime.Seconds()), i.Qualifier, float64(i.Price)/10000,
)
}

Expand Down

0 comments on commit 30ed9cd

Please sign in to comment.