# getVersion gives 2.2.21 for FMOD 2.02.15

**URL:** https://qa.fmod.com/t/getversion-gives-2-2-21-for-fmod-2-02-15/20432
**Category:** FMOD Engine
**Tags:** csharp
**Created:** [July 18, 2023, 3:04pm UTC](https://qa.fmod.com/t/getversion-gives-2-2-21-for-fmod-2-02-15/20432 "2023-07-18T15:04:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![janne-hmp](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@janne-hmp](https://qa.fmod.com/u/janne-hmp)
#### Post date: [July 18, 2023, 3:04pm UTC](https://qa.fmod.com/t/getversion-gives-2-2-21-for-fmod-2-02-15/20432/1 "2023-07-18T15:04:20Z")

</div>

I’m checking FMOD version on Android and iOS by using getVersion function of FMOD engine; see the code below. It reported the correct version number FMOD 2.0.9 that I was using earlier, but when I upgraded to FMOD 2.02.15, I’m getting now a version string of 2.2.21. This happens on both Android and iOS. Is there a bug or am I doing something wrong here?

```auto
        private static FMOD.System _coresystem = new FMOD.System();
        public uint GetVersionCode()
        {
            uint ver = 0;
            RESULT res = _coresystem.getVersion(out ver);
            if (res != RESULT.OK)
                return 0;

            return ver;
        }
        public string GetVersionString()
        {
            uint ver = GetVersionCode();
            if (ver == 0)
                return "";

            uint majorversion = (ver >> 16) & 0xFFFFU;
            uint minorversion = (ver >> 8) & 0xFFU;
            uint patchversion = ver & 0xFFU;

            string str = majorversion + "." + minorversion + "." + patchversion;
            return str;
        }

```

---

<div class="post-metadata">

### Author: ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)
#### Post date: [July 19, 2023, 1:43am UTC](https://qa.fmod.com/t/getversion-gives-2-2-21-for-fmod-2-02-15/20432/2 "2023-07-19T01:43:15Z")

</div>

Hi,

The issue is we use a Binary-coded decimal system which was fine until our version numbers entered the double digits. I have made a note to add this to our documentation.

The solution is to convert the patch version from its decimal value back to hexadecimal

```auto
string str = majorversion + "." + minorversion + "." + patchversion.ToString("X");

```

More information about the `toString("X")` function can be read here: [Standard numeric format strings](https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#:~:text=X%22%20or%20%22x%22-,Hexadecimal,-Result%3A%20A%20hexadecimal).

Hope this helps.

---

<div class="post-metadata">

### Author: ![janne-hmp](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@janne-hmp](https://qa.fmod.com/u/janne-hmp)
#### Post date: [July 19, 2023, 9:13am UTC](https://qa.fmod.com/t/getversion-gives-2-2-21-for-fmod-2-02-15/20432/3 "2023-07-19T09:13:14Z")

</div>

Thanks! Made that change, and now it works!
