Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Block Not Correct Value #13861

Closed
chuongmep opened this issue Mar 31, 2023 · 10 comments
Closed

Code Block Not Correct Value #13861

chuongmep opened this issue Mar 31, 2023 · 10 comments
Assignees
Labels

Comments

@chuongmep
Copy link
Contributor

chuongmep commented Mar 31, 2023

If this issue is with Dynamo for Revit, please post your issue on the Dynamo for Revit Issues page.

If this issue is not a bug report or improvement request, please check the Dynamo forum, and start a thread there to discuss your issue.

Dynamo version

2.18 Sanbox

Operating system

(e.g. Windows 7, Windows 8.1, etc)

What did you do?

Create a number string include character , inside code block : "1,34"

image

What did you expect to see?

it will be help return correct : "1,34"

What did you see instead?

image

@github-actions
Copy link

Hello chuongmep, thank you for submitting this issue! We are super excited that you want to help us make Dynamo all that it can be. However, we need some more information in order for the Dynamo team to investigate any further.

Can you please fill in the following to the best of your ability:

  • Operating system
  • What did you see instead?.

Additional information:

  • Filling in of the provided Template (What did you do, What did you expect to see, What did you see instead, What packages or external references (if any) were used)
  • Attaching the Stack Trace (Error message that shows up when Dynamo crashes - You can copy and paste this into the Github Issue)
  • Upload a .DYN file that showcases the issue in action and any additional needed files, such as Revit (Note: If you cannot share a project, you can recreate this in a quick mock-up file)
  • Upload a Screenshot of the error messages you see (Hover over the offending node and showcase said errors message in the screenshot)
  • Reproducible steps on how to create the error in question.

@github-actions github-actions bot added needs more info Needs more information from the reporter. and removed needs more info Needs more information from the reporter. labels Mar 31, 2023
@chuongmep
Copy link
Contributor Author

@Amoursol @QilongTang can give me quick look for this ?

@QilongTang
Copy link
Contributor

And would you want to get the number based on number format under current language from preferences or you would like just more robust parsing overall?

@QilongTang
Copy link
Contributor

@chuongmep
Copy link
Contributor Author

@QilongTang I mean is it is result wrong with my case. I just result return is correct with version 2.18

@mjkkirschner
Copy link
Member

mjkkirschner commented Apr 29, 2023 via email

@chuongmep
Copy link
Contributor Author

@mjkkirschner do we have any plan for this ? The version 2.17 is good for that.

@Amoursol
Copy link
Contributor

@chuongmep Dynamo 2.17 is already out (And finished back in November) so it's not in this version, nor will it be in 2.18 which was just released. We have a task in our backlog to look at this 😊

@avidit avidit added the tracked label Jun 7, 2023
@andydandy74
Copy link
Contributor

Seeing something similar happening to strings that contain integers in v2.18:
grafik

@iAliJ
Copy link
Contributor

iAliJ commented Jul 18, 2023

I have a question that might be related to this issue, why do we need to convert the obj in GetStringFromObject method defined in Watch view model to the reflecting type when we just need to return the string of that object?

private static string GetStringFromObject(object obj)
{
if (obj == null)
return Resources.NullString;
TypeCode type = Type.GetTypeCode(obj.GetType());
switch (type)
{
case TypeCode.Boolean:
return ObjectToLabelString(obj);
case TypeCode.Double:
return ((double)obj).ToString(numberFormat, CultureInfo.InvariantCulture);
//TODO: uncomment this once https://jira.autodesk.com/browse/DYN-5101 is complete
//return ((double)obj).ToString(ProtoCore.Mirror.MirrorData.PrecisionFormat, CultureInfo.InvariantCulture);
case TypeCode.Int32:
return ((int)obj).ToString(CultureInfo.InvariantCulture);
case TypeCode.Int64:
return ((long)obj).ToString(CultureInfo.InvariantCulture);
case TypeCode.DateTime:
return ((DateTime)obj).ToString(PreferenceSettings.DefaultDateFormat, CultureInfo.InvariantCulture);
case TypeCode.Object:
return ObjectToLabelString(obj);
default:
if (double.TryParse(obj.ToString(), out double d))
{
return Convert.ToDouble(obj).ToString(ProtoCore.Mirror.MirrorData.PrecisionFormat, CultureInfo.InvariantCulture);
}
return (string)obj;
};
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

7 participants