C# ASCII + Numpad 组合为 10 次方

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15098415/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 14:02:48  来源:igfitidea点击:

ASCII + Numpad combination for power 10

c#mathlanguage-agnostic

提问by Tommy

I am trying to do an assignment but when I write my answer (in Notepad - a plain text file), I cannot for the life of me figure out how to make the power 10 appear. I know that if I hold down ALT+0178 "2" will appear, but how do I get 10to appear or even 3, or 30or 40?

我正在尝试做一个作业,但是当我写下我的答案时(在记事本中 - 一个纯文本文件),我一生都无法弄清楚如何使 10 次幂出现。我知道如果我按住 ALT+0178 "2" 会出现,但我如何让10出现甚至3,或3040

I've tried looking online, but only see codes for 2 (and other, non-related ones). I've tried using the Character Map program in Windows but I couldn't find anything in there other than 2.

我试过在网上查找,但只看到 2(和其他不相关的)的代码。我试过在 Windows 中使用字符映射程序,但除了 2 之外我在那里找不到任何东西。

And to make this programming related, yes, I am writing an app for the Windows Store which will have to display these characters, but have no idea how to since I don't even know how to "type" them.

为了使这个编程相关,是的,我正在为 Windows 应用商店编写一个应用程序,它必须显示这些字符,但不知道如何显示,因为我什至不知道如何“键入”它们。

And no, this is not homework. :)

不,这不是家庭作业。:)

采纳答案by David Yaw

Make a superscript ten the same way you type it normally: with a one and a zero.

以与通常键入的方式相同的方式制作上标 10:一个 1 和一个零。

  • Superscript 1: Alt 0185 or Alt +00B9: 1
  • Superscript 2: Alt 0178 or Alt +00B2: 2
  • Superscript 3: Alt 0179 or Alt +00B3: 3
  • Superscript 4: Alt +2074: ?
  • Superscript 5: Alt +2075: ?
  • Superscript 6: Alt +2076: ?
  • Superscript 7: Alt +2077: ?
  • Superscript 8: Alt +2078: ?
  • Superscript 9: Alt +2079: ?
  • Superscript 0: Alt +2070: ?
  • 上标 1:Alt 0185 或 Alt +00B9:1
  • 上标 2:Alt 0178 或 Alt +00B2:2
  • 上标 3:Alt 0179 或 Alt +00B3:3
  • 上标 4:Alt +2074:?
  • 上标 5:Alt +2075:?
  • 上标 6:Alt +2076:?
  • 上标 7:Alt +2077:?
  • 上标 8:Alt +2078:?
  • 上标 9:Alt +2079:?
  • 上标 0:Alt +2070:?

If you're writing code, the better way to refer to them in code is with the proper escape code. The syntax here is for C/C++/C#/Java, but other languages should have something similar.

如果您正在编写代码,在代码中引用它们的更好方法是使用正确的转义码。这里的语法适用于 C/C++/C#/Java,但其他语言应该有类似的东西。

  • Superscript 1: "\u00B9"
  • Superscript 2: "\u00B2"
  • Superscript 3: "\u00B3"
  • Superscript 4: "\u2074"
  • Superscript 5: "\u2075"
  • Superscript 6: "\u2076"
  • Superscript 7: "\u2077"
  • Superscript 8: "\u2078"
  • Superscript 9: "\u2079"
  • Superscript 0: "\u2070"
  • 上标 1:“\u00B9”
  • 上标 2:“\u00B2”
  • 上标 3:“\u00B3”
  • 上标 4:“\u2074”
  • 上标 5:“\u2075”
  • 上标 6:“\u2076”
  • 上标 7:“\u2077”
  • 上标 8:“\u2078”
  • 上标 9:“\u2079”
  • 上标 0:“\u2070”

回答by dko

Did you try pressing "^" this symbol every time you want the number to appear as a power?

每次希望数字显示为幂时,您是否尝试按“^”这个符号?

回答by Charlie Kilian

I do not believe there is a Unicode character for the power of 10. Notepad allows you to enter text, and the Alt+NumPad keystrokes give you a way to enter a Unicode character. But to the best of my knowledge, the character you are looking for does not exist.

我不相信有 10 次方的 Unicode 字符。记事本允许您输入文本,而 Alt+NumPad 按键为您提供了一种输入 Unicode 字符的方法。但据我所知,您要找的角色并不存在。

回答by 3Dave

The 2 exponent character is an extended ASCII character (253 decimal); there is no equivalent for 10. See the ASCII tablefor a list of what's available in typical character sets.

2 指数字符是扩展的 ASCII 字符(十进制 253);没有 10 的等效项。有关典型字符集中可用内容的列表,请参阅ASCII 表

Consider using Word (or any word processor, or Mathematica which makes entering formulas and "math notation" very easy, and you can execute it!) for this type of thing as Notepad isn't really up to the challenge. Every word processor I've used offers superscript (exponent) character styling, and some (including Word) offer a "formula editor."

考虑使用 Word(或任何文字处理器,或 Mathematica,它使输入公式和“数学符号”变得非常容易,并且您可以执行它!),因为记事本并不能真正应对挑战。我使用过的每个文字处理器都提供上标(指数)字符样式,有些(包括 Word)提供“公式编辑器”。

回答by Tony L.

Here is a superscript generator to copy/paste from. I'm having varying degrees of success for 0 and numbers higher than 4, depending on what I'm pasting into. It has to do with the character encoding of whatever tool you are pasting into. Tommy and David discuss this in the comments above.

这是一个用于复制/粘贴的上标生成器。我在 0 和高于 4 的数字上取得了不同程度的成功,这取决于我粘贴的内容。它与您粘贴到的任何工具的字符编码有关。汤米和大卫在上面的评论中讨论了这一点。

https://lingojam.com/SuperscriptGenerator

https://lingojam.com/SuperscriptGenerator

The creator also made a subscript generator: https://lingojam.com/SubscriptGenerator

创作者还做了一个下标生成器:https: //lingojam.com/SubscriptGenerator