r/visualbasic • • Aug 15 '19

Limiting number of characters in string, Noob question

Hello All,

I've written a quick program to convert a C Temp Value to F Type Value. It works perfect. However, I just want it show the first two numbers. For instance, I want it to show 74 rather than 74.533.

Here is what I wrote:

Dim tempF As String

tempF = ((tempC * (9 / 5)) + 32)

label4.text = TempF

How do I truncate the value?

Thank you very much!

EDIT: Quick typo fix

6 Upvotes

Duplicates