Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7575811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:46:15+00:00 2026-05-30T16:46:15+00:00

I’m having trouble with this equation in getting it to return the proper value.

  • 0

I’m having trouble with this equation in getting it to return the proper value. According to Steam, the equation Steam_community_number = (Last_part_of_steam_id * 2) + 76561197960265728 + Second_to_last_part_of_steam_id Should return the 64 bit Steam Community ID. Currently, this equation is returning 7.6561198012096E+16. The equation should be returning 76561198012095632 which in a way is almost the same as what it is already returning. How would I convert the returned E+16 value to the correct value as stated above in my code below? Thanks.

function convertSID($steamid) {
    if ($steamid == null) { return false; }
    //STEAM_X:Y:Z
    //W=Z*2+V+Y
    //Z, V, Y
    //Steam_community_number = (Last_part_of_steam_id * 2) + 76561197960265728 + Second_to_last_part_of_steam_id
    if (strpos($steamid, ":1:")) {
        $Y = 1;
    } else {
        $Y = 0;
    }
    $Z = substr($steamid, 10);
    $Z = (int)$Z;
    echo "Z: " . $Z . "</br>";
    $cid = ($Z * 2) + 76561197960265728 + $Y;
    echo "Equation: (" . $Z . " * 2) + 76561197960265728 + " . $Y . "<br/>";
    return (string)$cid;
}

And I am calling this function with $cid = convertSID("STEAM_0:0:25914952");

If you would like to see an example of the output, check here: http://joshua-ferrara.com/hkggateway/sidtester.php

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:46:16+00:00Added an answer on May 30, 2026 at 4:46 pm

    Change

    return (string)$cid;
    

    to

    return number_format($cid,0,'.','');
    

    Be aware that this will return a string, and if you do any math on it, it will be converted back to float. To do math on large integers use bc_math extension: http://www.php.net/manual/en/book.bc.php

    edit: your function converted to use bcmath:

    function convertSID($steamid) {
        if ($steamid == null) { return false; }
        //STEAM_X:Y:Z
        //W=Z*2+V+Y
        //Z, V, Y
        //Steam_community_number = (Last_part_of_steam_id * 2) + 76561197960265728 + Second_to_last_part_of_steam_id
    
        $steamidExploded = explode(':',$steamid);
        $Y = (int)steamidExploded[1];
        $Z = (int)steamidExploded[2];
        echo "Z: " . $Z . "</br>";
        $cid = bcadd('76561197960265728 ',$Z * 2 + $Y);
        echo "Equation: (" . $Z . " * 2) + 76561197960265728 + " . $Y . "<br/>";
        return $cid;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.