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

  • SEARCH
  • Home
  • 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 1044953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:54:38+00:00 2026-05-16T15:54:38+00:00

How can I transform from one scale of notation to another using my custom

  • 0

How can I transform from one scale of notation to another using my custom function by C#.

abstract string Convert(string value, string fromBase, string toBase);

value – string representation scale of notation in basic notation

fromBase – string represent the base of numeric

toBase – string representation the base of numeric which you must to transform

P.S.
string which represents the base position scale of notation can include any symbols for represent numeral ascending order

For example

Value = “GSAK”

   fromBase = “A,S,G,K” – four(4) is the base scale of notation (If write arabic figures:  0,1,2,3)
   toBase= “0,1,2,3,4,5,6,7,8,9” – ten(10) is the base scale of notation
   return value = “147”
  • 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-16T15:54:39+00:00Added an answer on May 16, 2026 at 3:54 pm

    I would first translate the input value to one of the numeric data types (i.e. long), and then encode into the target format. Draft implementation of a class to do the parsing and encoding (untested and certainly not optimal):

    public class Formatter
    {
      List<char> symbols;
      int base;
    
      public Formatter(string format)
      {
        string[] splitted = format.Split(",");
        symbols = splitted.Select(x => x[0]).ToList();
        base = symbols.Size;
      }
    
      public long Parse(string value)
      {
        long result = 0;
        foreach(char c in value)
        {
          long n = symbols.IndexOf(c);
          result = result*base+n;
        }
        return result;
      }
    
      public string Encode(long value)
      {
        StringBuilder sb = new StringBuilder();
        while(value>0)
        {
          long n = value % base;
          value /= base;
          sb.Insert(0, symbols[n]);
        }
        return sb.ToString();
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using XSLT to transform from one format of XML into another but I
I'm using an XSLT to transform from one XML standard to another. The particular
I'm trying to return a value from (transport) to the calling function, but can't
I'm trying convert xml from one format to other using the XslCompiledTransform in c#.
How can I transfer specific rows from one MySQL DB on one server to
Hough Transform can be used to extract lines from images. It can also be
I have one spring batch application which can be run from command line. The
There are methods to transfer a CGPoint from one UIView to another and from
I am writing a basic file dump from one database to another. I am
I am trying to write XSLT to transform my XML from one format to

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.