Questions tagged [strconv]

29 questions
1
vote
2 answers

How do I capitalize all text in a column of data in an Access Query while keeping the name of the field the same?

How do I capitalize all text in a column of data in an Access Query while keeping the name of the field the same? I tried entering "SPEC: StrConv([SPEC],3), but I get an error that I have a circular argument (which, isn't too surprising). So how do…
theforestecologist
  • 4,667
  • 5
  • 54
  • 91
1
vote
2 answers

Detect value out of range errors using type assertion in Golang

Given the following code: iv, err := strconv.ParseInt("18446744073709551448", 10, 64) fmt.Println(iv) fmt.Printf("%#v\n", err) fmt.Printf("%v\n", err) //Output: 9223372036854775807 &strconv.NumError{Func:"ParseInt", Num:"18446744073709551448",…
Greg Bray
  • 14,929
  • 12
  • 80
  • 104
0
votes
3 answers

Golang parse array

I am trying to figure out why my code is not working. I wish to take a slice of numbers and strings, and separate it into three slices. For each element in the slice, if it is a string, append it to the strings slice, and if it is a positive number,…
user3015224
  • 27
  • 2
  • 5
0
votes
1 answer

strconv.Atoi in Go (Basic calculator)

I'm trying to make a basic adding calculator in Go (complete noob here), but every time I'm getting an output of 0. This is the code: package main import ( "fmt" "strconv" //"flag" "bufio" "os" ) func main(){ reader :=…
0
votes
1 answer

Report Definition Field Proper Case

i'm working on a rdlc file, for a report. I need the value of a field to be on ProperCase, however the syntax seems to be wrong. Using the formula StrConv... Using the formula ProperCase, it's not even recognized...
0
votes
2 answers

visual basic search text for string, display results with propercase

...databox.text (from example code below) contains a large list of combined words(domain names) previously populated in the program. There is 1 per each line. In this example, it initially looks…
t4nk
  • 3
  • 4
0
votes
1 answer

Why I do get Go error "panic: strconv: illegal AppendInt/FormatInt base"

I can't figure out, why I do get this error message during run time. It triggers even with the most simple one-liner: strconv.FormatUint(uint64(123), 64) Have I understood something very wrong here? The code compiles just fine. EDIT: Found a…
Ahti Ahde
  • 1,078
  • 10
  • 12
0
votes
1 answer

Read CSV String Into List of Custom Objects Go Language

I am trying to read a string of data from a csv file and parse the data into a list of custom objects. The main issue that I am having is converting the data to the correct datatype within the loop. Here is my custom object: type yahooInfoObj struct…
Aaron
  • 1,061
  • 3
  • 14
  • 22
0
votes
1 answer

How to apply STRCONV Propercase to the cell value in VBA Excel

I'm trying to use STRCONV vbPropercase to correct input in a macro that I use to copy data from one "input" worksheet to another. I have been able to assign specific variables to cells and then apply the STRCONV Propercase to the variable, but no…
rodlonghorn
  • 15
  • 1
  • 5
0
votes
1 answer

Converting a byte array with system locale set to Japanese in VB6

In my legacy VB6 application I'm receiving a zip file as a byte array from a webservice. This byte array is converted to a string using the StrConv function and stored on the file system. Dim arr() As Byte Dim sUnicode as String nFile =…
-1
votes
1 answer

Golang Truncating Float32 From Scanner Input

I am attempting to create a program where you can input a float32 into a scanner, and have the output be a truncation of the float, removing all digits from the right of the decimal place. Example: Input: 6.7777 Output: 6 The problem I'm having…
CodeDragon
  • 29
  • 7
-1
votes
2 answers

Why does this conversion in go from a rune-string to integer does not work?

i have the following code: I know about runes in go, i read about them a lot in the last hours i have tried to solve this... package main import ( "fmt" "strconv" ) func main() { e := "\x002" fmt.Println(e) new := string(e) …
jk2
  • 79
  • 7
-2
votes
2 answers

How to check err type returned from function(strconv.Atoi)

I have the following basic code that tests strconv.Atoi(): package main import ( "fmt" "strconv" ) func main() { var a int var b string var err Error b = "32" a,err = strconv.Atoi(b) …
M.E.
  • 4,955
  • 4
  • 49
  • 128
-2
votes
1 answer

parsing the bytes from a shell program in my golang program

i am trying to call a shell program using golang (os/exec) but the output i am getting is in bytes and i need to convert it into float64 but it is showing error? error: cannot convert out (type []byte) to type float64 func Cpu_usage_data()…
azee
  • 27
  • 1
  • 7
1
2