右对齐字节 [英] Right alignment in bytes

查看:110
本文介绍了右对齐字节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



我正在从数据记录器中读取数据,它给出了左对齐的字节数。



我一直在搜索一个允许我将字节对齐到右边的函数。

例如:数字:0110 1000.

我想要的结果是:0000 1101.





提前致谢。

Hi everyone.

I'm reading data from a datalogger and it gives me the bytes with left alignment.

I've been searching a function that allows me to align that bytes to the right.
For example: the number: 0110 1000 .
The result i want is: 0000 1101.


Thanks in advance.

推荐答案

没有功能可以给你一个基于单个例子的结果 - 特别是当输入之间没有明显的关系时:

There is no "function" that can give you a result like that based on a single example - particularly when there is no obvious relationship between the input:
0110 1000

和预期输出:

and the expected output:

0000 1110





我建议您查看数据记录器的手册或数据表,并尝试更详细地计算实际数据提供的内容...



I suggest that you look at the manual or datasheets for the datalogger and try to work out in better detail what the dat ait provides actually is...


像PadLeft一样使用在这种情况下可能对你有帮助的功能
Use like PadLeft function that might help you in this case


这篇关于右对齐字节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆