git add之后没有进行更改(Changes not staged after git add)
在运行
git add .
之后,为什么我会在Changes not staged for commit
项目git add .
?> git add . > git st # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # (commit or discard the untracked or modified content in submodules) # # modified: bin/ls-- (modified content, untracked content) #
这是在
Red Hat 4.1.2-50
使用git 1.7.10.
Why would I get items in the
Changes not staged for commit
after I rungit add .
?> git add . > git st # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # (commit or discard the untracked or modified content in submodules) # # modified: bin/ls-- (modified content, untracked content) #
This is on
Red Hat 4.1.2-50
withgit 1.7.10.
原文:https://stackoverflow.com/questions/14368755
最满意答案
您的
printf
可能已经能够通过'
旗帜'
自己做到这一点。 不过,您可能需要设置您的语言环境。 下面是我的机器的一个例子:#include <stdio.h> #include <locale.h> int main(void) { setlocale(LC_NUMERIC, ""); printf("$%'.2Lf\n", 123456789.00L); printf("$%'.2Lf\n", 1234.56L); printf("$%'.2Lf\n", 123.45L); return 0; }
并运行它:
> make example clang -Wall -Wextra -Werror example.c -o example > ./example $123,456,789.00 $1,234.56 $123.45
该程序的工作方式既可以在我的Mac(10.6.8)上运行,也可以在我试过的Linux机器上运行(Ubuntu 10.10)。
Your
printf
might already be able to do that by itself with the'
flag. You probably need to set your locale, though. Here's an example from my machine:#include <stdio.h> #include <locale.h> int main(void) { setlocale(LC_NUMERIC, ""); printf("$%'.2Lf\n", 123456789.00L); printf("$%'.2Lf\n", 1234.56L); printf("$%'.2Lf\n", 123.45L); return 0; }
And running it:
> make example clang -Wall -Wextra -Werror example.c -o example > ./example $123,456,789.00 $1,234.56 $123.45
This program works the way you want it to both on my Mac (10.6.8) and on a Linux machine (Ubuntu 10.10) I just tried.
相关问答
更多-
C#货币格式(C# Currency format)[2023-05-28]
totalLabel.Text = String.Format("{0:C}", cmd.ExecuteScalar()); totalLabel.Text = String.Format("{0:C}", cmd.ExecuteScalar()); -
C#从数据库格式化货币(C# Format Currency From Database)[2021-11-08]
我想你需要像这样分开它: double p = Convert.ToDouble(dt.Rows[i]["itemPrice"]); var pi = (int)p; double pr = (p - pi)*100; string formattedPrice = string.Format("{0:C0}.{1:00}", pi,pr); I think you need to split it like this: double p = Convert.ToDouble(d ... -
C#格式化货币(C# Formatting Currency)[2022-04-16]
遵循基本的数学原则,案例4,5,6和7不应该花费一分钱。 你不会从最右边的数字开始并四舍五入。 你只看到你想要的数字右边的一个数字。 http://www.enchantedlearning.com/math/rounding/ 计算机正在执行基本的数学计算,因为他们应该这样做。 编辑 - 添加 更好的链接: http : //math.about.com/od/arithmetic/a/Rounding.htm Following basic mathematical principles, cases ... -
试试这种方式 public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var dValue = value as decimal?; Thread.CurrentThread.CurrentCulture = new CultureInfo("de"); var nfi = (NumberFormatInfo)NumberFormatInfo.Curre ...
-
NSNumberFormatter允许您格式化货币。 取自[iOS开发人员:提示]的示例; // Create formatter NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; //-------------------------------------------- // Format style as currency, output to console //--------------------------- ...
-
您的printf可能已经能够通过'旗帜'自己做到这一点。 不过,您可能需要设置您的语言环境。 下面是我的机器的一个例子: #include
#include int main(void) { setlocale(LC_NUMERIC, ""); printf("$%'.2Lf\n", 123456789.00L); printf("$%'.2Lf\n", 1234.56L); printf("$%'.2Lf\n", 123.45L) ... -
您可以更改文化中的货币符号。 创建一个文化的副本,然后改变任何你想要的: var culture = (CultureInfo)CultureInfo.CurrentCulture.Clone(); culture.NumberFormat.CurrencySymbol = "€"; @String.Format(culture, "{0:C}", 12); 也许你可以保留一些静态变量的文化副本,所以不需要克隆每个请求... You can change the currency symbol in th ...
-
下面是基本方法,当文本更改将其转换为小数时,然后将文本更改为小数的字符串表示形式。 textBox1.TextChanged += (s,e) => { var value = Decimal.Parse(textBox1.Text); textBox1.Text = value.ToString("C"); } 您还应该检查textBox中的非法号码。 看看Decimal.TryParse 。 Upon research I came across this code. This code ...
-
您可以使用绑定处理程序并创建自定义绑定: ko.bindingHandlers.numeric = { update: function(element, valueAccessor, allBindingsAccessor) { var value = ko.utils.unwrapObservable(valueAccessor()); var positions= ko.utils.unwrapObservable(allBindingsAccessor().pos ...
-
尝试以下方法: NSNumberFormatter * formatter = [[[NSNumberFormatter alloc] init] autorelease]; formatter.numberStyle = NSNumberFormatterCurrencyStyle; formatter.currencyCode = @"USD"; NSString * formattedAmount = [formatter stringFromNumber: @100 ...