fmt.Sprintf()
// formatting results into new variables
formatedFV := fmt.Sprintf("Future Value: %.2f $", futureValue)
formatedRFV := fmt.Sprintf("Future Value adjusted for Inflation: %.2f $", futureRealValue)
// output both values
fmt.Printf("%s\n%s", formatedFV, formatedRFV)Last updated