Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

convert

package main

import (
    "fmt"
    "strconv"
    )

func main() {
   fmt.Printf("hello, world\n")
   fmt.Println(convert("00.123"))
  fmt.Println(convert("001231.123"))
   fmt.Println(convert("55.123"))  
  fmt.Println(convert("14700.123000"))
     fmt.Println(convert("00.00"))
         
}


func convert(originalValue string ) (finalValue string ){
value, _ := strconv.ParseFloat(originalValue, 64)
   finalValue = strconv.FormatFloat(value, 'f',4,64)
    
    return
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.