C
C#

help

Hexadecimal format specifier not working

?11/2/2022
for(int X = 1 ; X <= 5 ; X++)
{
var F = Math.Pow(63, X);
Console.WriteLine($"{F:X}");
}
for(int X = 1 ; X <= 5 ; X++)
{
var F = Math.Pow(63, X);
Console.WriteLine($"{F:X}");
}
For some reason this is not working and I receive an error: FormatException: Format specifier was invalid. And even if I try F.ToString("X") it's also not working
Mmtreit11/2/2022
It's because your variable F is a floating point number. It needs to be an integer. Also don't use capital letters for variable names.
?11/2/2022
Okay, that worked! I didn't know it works only for integers, thanks!

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
DotCover shows class with no methods is 0% coveredDotCover shows this class is 0% covered. However it is just a model it does not have any code of itsPassing a string property to a command via a button CommandParameter in .NET 6Hello So I'm trying to pass a string (that's bound to a text field via a data context `<TextBox [..❔ How to consume RSS ReaderHi I never work with RSS before does anyone have simple console app that consuming Microsoft DevblogWhy does this not work? [Answered]Hey, pretty new to coding and trying some things out, someone knows why it says that my var "randomNGitLab CI CD artifacts not being carried forward to next step. [Answered]I'm having a hard time carrying artifacts from one stop of the GitLab CI/CD pipeline to the next. Ancrankshaft rotationI am making a program that dictates the position of the piston in millimeters with respect to the de❔ Build .sln with MsBuildI try to build sln file from github with MsBuild, and i get this error. repo: https://github.com/ca1Remove X-AspNetMvc-Version from the response.I defined my web.config as below but still I can able to see them in header result. How to remove thomnisharp-vim doesn't recognize recordI used `vim-plug` to install `omnisharp-vim` ``` Plug 'https://github.com/OmniSharp/omnisharp-vim' PCreating DataTable columns dynamically - CHey guys, currently I have an implementation of jQuery DataTables that wont allow to add columns dyhow to get client server lag of 2 machines running on the local networktitleError in AsNoTracking()I don't know why it show this error. NOMOR is string and unique value.