Query_Lang-PCBFunctions_Parameters_StrToNumberDefStrToNumberDef_AD

This document is no longer available beyond version 21. Information can now be found here: StrToNumberDef for version 24

Parent page: PCB Query Functions - Parameters

Summary

Converts the nominated Parameter Value string to a number, or a default number, using the stipulated unit type.

Syntax

StrToNumber(Value : String , Unit : String , Default : Number) : Number

Example Usage

StrToNumberDef(ParameterValue('VoltageRating'),V,10)  >  50
Converts the Value string returned by the VoltageRating Parameter to a number, using Voltage (V) as the unit, then returns all objects with a Value greater than 50V. If the Parameter string or unit is unrecognized (can't be converted), a default value of 10 is returned.

StrToNumberDef(ParameterValue('VoltageRating'),'V',6) Between 10 And 50
Converts the Value string returned by the VoltageRating Parameter to a number, using Voltage (V) as the unit, then returns all objects with a Value rating between 10V and 50V. If the value cannot be read, a voltage of 6V (the defined default value) is assumed.

TIPS

The unit-aware string-to-number converter function accepts a large range of Unit type definitions, including:

  • V – Voltage
  • A – Current
  • Ohm – Resistance
  • Z – Impedance
  • F – Capacitance
  • H – Inductance
  • G – Conductance
  • W – Power
  • Hz – Frequency
  • Q – Charge
  • C – Temperature
  • dB – Decibels
  • % – Percent
  • m – Length
  • Kg – Mass
  • s – Time

The converter accepts standard value scaling factors (micro, kilo, mega etc) and therefore Parameter strings containing prefix abbreviations such as mV, uA, kHz etc.

Several value constructs are also supported. For example, the same resistance value can be represented as:

  • 2k2
  • 2.2k
  • 2200
  • 2,200
If you find an issue, select the text/image and pressCtrl + Enterto send us your feedback.
참고

Altium 제품에 접근할 수 있는 레벨에 따라 사용할 수 있는 기능이 달라집니다. 다양한 레벨의 Altium Designer Software Subscription에 포함된 기능과 Altium 365 플랫폼에서 제공하는 애플리케이션을 통해 제공되는 기능을 비교해보세요.

소프트웨어에서 논의된 기능을 찾을 수 없는 경우, Altium 영업팀에 문의하여 자세한 정보를 확인해주세요.