adrianmo / go-nmea

A NMEA parser library in pure Go
MIT License
226 stars 77 forks source link

timestamp : Fixed milliseconds timestamp parsing issue. #40

Closed anekkunt closed 5 years ago

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling cd1a2277820cc17ca58c8fc3a65e355ff758c9f9 on anekkunt:master into 0c836e0bc0e6d7fe34386f5514b020528e8c9f53 on adrianmo:master.

icholy commented 6 years ago

@anekkunt can you update the failing test?

icholy commented 6 years ago

Time.String also needs to change

anekkunt commented 6 years ago

Time.String also needs to change

No need to change Time.String which is already in a correct format (hh:mm:ss.ss), in this case, milliseconds are represented in seconds i.e 500ms = 0.5 sec

icholy commented 6 years ago
package main

import (
    "fmt"

    "github.com/adrianmo/go-nmea"
)

func main() {
    fmt.Println(nmea.Time{
        Millisecond: 500,
    })
}

Outputs: 00:00:00.0500